fixed paccache

This commit is contained in:
2020-08-12 10:35:19 +02:00
parent f82cf08545
commit 8fd8f2a46f

View File

@@ -56,7 +56,7 @@ def build(pkgbuild, repo):
os.chdir(pathlib.Path(pkgbuild).parent)
res = subprocess.run(["sudo", "extra-x86_64-build"], capture_output=True)
if res.returncode:
logging.warning("[%s-%s] Build failed: %s", name, repo, res)
logging.warning("[%s/%s] Build failed: %s", repo, name, res)
subprocess.run(["git", "clean", "-xdf"], check=True, capture_output=True)
os.chdir(sys.path[0])
return
@@ -66,7 +66,7 @@ def build(pkgbuild, repo):
for pkg in pkgs:
s_res = subprocess.run(["gpg", "--batch", "--detach-sign", pkg], capture_output=True)
if s_res.returncode:
logging.error("[%s-%s] Signing failed: %s", name, repo, s_res)
logging.error("[%s/%s] Signing failed: %s", repo, name, s_res)
subprocess.run(["git", "clean", "-xdf"], check=True, capture_output=True)
os.chdir(sys.path[0])
return
@@ -74,7 +74,7 @@ def build(pkgbuild, repo):
# copying
pkgs.extend(glob.glob("*.pkg.tar.zst.sig"))
for pkg in pkgs:
logging.debug("[%s-%s] Copy %s to %s", name, repo, pkg,
logging.debug("[%s/%s] Copy %s to %s", repo, name, pkg,
os.path.join(config["basedir"]["repo"], repo, "os", config["arch"] + "/"))
shutil.copy2(pkg, os.path.join(config["basedir"]["repo"], repo, "os", config["arch"] + "/"))
@@ -83,16 +83,16 @@ def build(pkgbuild, repo):
os.path.join(config["basedir"]["repo"], repo, "os", config["arch"], repo + ".db.tar.xz"),
pkgs[0]], capture_output=True)
if r_res.returncode:
logging.error("[%s-%s] Repo action failed: %s", name, repo, r_res)
logging.error("[%s/%s] Repo action failed: %s", repo, name, r_res)
subprocess.run(["git", "clean", "-xdf"], check=True, capture_output=True)
os.chdir(sys.path[0])
return
p_res = subprocess.run(
["paccache", "-rc", "-k 1", os.path.join(config["basedir"]["repo"], repo, "os", config["arch"])],
["paccache", "-rc", os.path.join(config["basedir"]["repo"], repo, "os", config["arch"]), "-k 1"],
capture_output=True)
if p_res.returncode:
logging.error("[%s-%s] Repo cleanup failed: %s", name, repo, p_res)
logging.error("[%s/%s] Repo cleanup failed: %s", repo, name, p_res)
subprocess.run(["git", "clean", "-xdf"], check=True, capture_output=True)
os.chdir(sys.path[0])
return
@@ -100,7 +100,7 @@ def build(pkgbuild, repo):
# cleanup
subprocess.run(["git", "clean", "-xdf"], check=True, capture_output=True)
os.chdir(sys.path[0])
logging.info("[%s-%s] Build successful (%s)", name, repo, time.time() - start_time)
logging.info("[%s/%s] Build successful (%s)", repo, name, time.time() - start_time)
def setup_makepkg(repo):