diff --git a/master.py b/master.py index 3036ed6..7ff7da2 100644 --- a/master.py +++ b/master.py @@ -112,16 +112,15 @@ def run_worker() -> None: def do_repo_work() -> None: for repo in repos: - args = ["repo-add", "-s", "-v", "-p", "-n", - os.path.join(config["basedir"]["repo"], repo, "os", config["arch"], repo + ".db.tar.xz"), "*.zst"] + 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) 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", os.path.join(config["basedir"]["repo"], repo, "os", config["arch"]), "-k", "1"], - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + ["paccache", "-rc", ".", "-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"))