modified logging again, more build failed out

This commit is contained in:
2020-08-12 10:28:22 +02:00
parent d86268bfc5
commit 004bf06669

View File

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