From 1e224335ea0bb3639d54fa5fce5dd7f82a794911 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Sun, 30 May 2021 20:26:27 +0200 Subject: [PATCH] some more repo-add fixes --- master.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/master.py b/master.py index 872472a..f2205d9 100644 --- a/master.py +++ b/master.py @@ -112,15 +112,18 @@ def run_worker() -> None: def do_repo_work() -> None: for repo in repos: - os.chdir(os.path.join(config["basedir"]["repo"], repo, "os", config["arch"])) - args = ["repo-add", "-s", "-v", "-p", "-n", repo + ".db.tar.xz", "*.zst"] - r_res = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) + pkgs = glob.glob(os.path.join(config["basedir"]["repo"], repo, "os", config["arch"], "*.zst")) + args = ["repo-add", "-s", "-v", "-p", "-n", + os.path.join(config["basedir"]["repo"], repo, "os", config["arch"], repo + ".db.tar.xz")] + args.extend(pkgs) + r_res = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) logging.debug("[REPO-ADD] %s", r_res.stdout.decode(errors="ignore")) if r_res.returncode: logging.error("[REPO/%s] Repo action failed: %s", repo, r_res.stdout.decode(errors="ignore")) p_res = subprocess.run( - ["paccache", "-rc", ".", "-k", "1"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + ["paccache", "-rc", os.path.join(config["basedir"]["repo"], repo, "os", config["arch"]), "-k", "1"], + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) logging.debug("[PACCACHE] %s", p_res.stdout.decode(errors="ignore")) if p_res.returncode: logging.error("[REPO/%s] Repo cleanup failed: %s", repo, p_res.stdout.decode(errors="ignore"))