diff options
author | davidovski <david@davidovski.xyz> | 2022-01-17 22:05:05 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-01-17 22:05:05 +0000 |
commit | 310abf6ca7666e25277d2ae92da53861ce6bf039 (patch) | |
tree | 0e8b04eadadb3337da5c700bc0f9eb76bb69222a /src/verbs/sync.py | |
parent | 0746a72f4267664a572902c6af39c05f10b85760 (diff) |
moved post install checking to sync
Diffstat (limited to 'src/verbs/sync.py')
-rw-r--r-- | src/verbs/sync.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/verbs/sync.py b/src/verbs/sync.py index 5559fcb..f81716b 100644 --- a/src/verbs/sync.py +++ b/src/verbs/sync.py @@ -7,6 +7,23 @@ import sys CACHE_DIR = "/var/cache/xipkg" +def run_post_install(config, verbose=False, root="/"): + if root == "/": + installed_dir = util.add_path(root, config["dir"]["postinstall"]) + if os.path.exists(installed_dir): + files = os.listdir(installed_dir) + if len(files) > 0: + done = 0 + for file in files: + util.loading_bar(done, len(files), f"Running Postinstalls...") + f = util.add_path(config["dir"]["postinstall"], file) + command = f"sh {f}" + os.chdir("/") + os.system(command) + os.remove(f) + done += 1 + util.loading_bar(len(files), len(files), f"Run Postinstalls") + # returns a dictionary, and duration: # key: package name # value: list of info [checksum, size] |