some more repo-add fixes
This commit is contained in:
11
master.py
11
master.py
@@ -112,15 +112,18 @@ def run_worker() -> None:
|
|||||||
|
|
||||||
def do_repo_work() -> None:
|
def do_repo_work() -> None:
|
||||||
for repo in repos:
|
for repo in repos:
|
||||||
os.chdir(os.path.join(config["basedir"]["repo"], repo, "os", config["arch"]))
|
pkgs = glob.glob(os.path.join(config["basedir"]["repo"], repo, "os", config["arch"], "*.zst"))
|
||||||
args = ["repo-add", "-s", "-v", "-p", "-n", repo + ".db.tar.xz", "*.zst"]
|
args = ["repo-add", "-s", "-v", "-p", "-n",
|
||||||
r_res = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
|
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"))
|
logging.debug("[REPO-ADD] %s", r_res.stdout.decode(errors="ignore"))
|
||||||
if r_res.returncode:
|
if r_res.returncode:
|
||||||
logging.error("[REPO/%s] Repo action failed: %s", repo, r_res.stdout.decode(errors="ignore"))
|
logging.error("[REPO/%s] Repo action failed: %s", repo, r_res.stdout.decode(errors="ignore"))
|
||||||
|
|
||||||
p_res = subprocess.run(
|
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"))
|
logging.debug("[PACCACHE] %s", p_res.stdout.decode(errors="ignore"))
|
||||||
if p_res.returncode:
|
if p_res.returncode:
|
||||||
logging.error("[REPO/%s] Repo cleanup failed: %s", repo, p_res.stdout.decode(errors="ignore"))
|
logging.error("[REPO/%s] Repo cleanup failed: %s", repo, p_res.stdout.decode(errors="ignore"))
|
||||||
|
Reference in New Issue
Block a user