From 310abf6ca7666e25277d2ae92da53861ce6bf039 Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 17 Jan 2022 22:05:05 +0000 Subject: moved post install checking to sync --- src/verbs/install.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/verbs/install.py') diff --git a/src/verbs/install.py b/src/verbs/install.py index 4c91291..671154b 100644 --- a/src/verbs/install.py +++ b/src/verbs/install.py @@ -6,7 +6,7 @@ import time import requests import hashlib -from verbs.sync import sync +from verbs.sync import sync, run_post_install def get_best_source(available, sources_list="/var/lib/xipkg/sources"): source_speeds = {} @@ -273,7 +273,7 @@ def install_package(package_name, package_path, package_info, # TODO loading bar here files = util.extract_tar(package_path, root) if post_install: - run_post_install(config, verbose=verbose, root=root) + run_post_install(config, verbose=verbose, rost=root) save_installed_info(package_name, package_info, files, repo, source_url, key, config, root=root) return files @@ -311,20 +311,6 @@ def save_installed_info(package_name, package_info, file.write(files) -def run_post_install(config, verbose=False, root="/"): - installed_dir = util.add_path(root, config["dir"]["postinstall"]) - if os.path.exists(installed_dir): - files = os.listdir(installed_dir) - for file in files: - f = util.add_path(config["dir"]["postinstall"], file) - command = f"sh {f}" - if root != "/": - os.chroot(root) - os.chdir("/") - os.system(command) - os.remove(f) - - def install_single(package, options, config, post_install=True, verbose=False, unsafe=False): checksum, sources, repo, size, files = find_package(package, config["repos"], config["dir"]["packages"], config["sources"]) @@ -408,7 +394,7 @@ def install_multiple(to_install, args, options, config, terminology=("install", (package, package_path, source, key, repo, info) = f files = install_package(package, package_path, info, - repo, source, key, True, + repo, source, key, root == "/", config, verbose=v, root=options["r"]) extracted += len(files.split("\n")) -- cgit v1.2.1