From 8f396ead36f3579d8a950cd8cf4f93dec977fd02 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Fri, 28 May 2021 03:54:20 +0200 Subject: [PATCH] clean working dir after build --- master.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/master.py b/master.py index 98aac49..8f6ff23 100644 --- a/master.py +++ b/master.py @@ -64,6 +64,9 @@ def build(pkgbuild: str, repo: str, todo: dict) -> None: with open(os.path.join(config["basedir"]["repo"], "logs", repo, name + ".log"), "w") as log: log.write(res.stdout.decode(errors="ignore")) + logging.debug("[GIT] %s", subprocess.run(["git", "clean", "-xdff"], check=False, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT).stdout.decode(errors="ignore")) + return # signing @@ -74,6 +77,8 @@ def build(pkgbuild: str, repo: str, todo: dict) -> None: if s_res.returncode: logging.error("[%s/%s/%s] Signing failed: %s", process_name, repo, name, s_res.stdout.decode(errors="ignore")) + logging.debug("[GIT] %s", subprocess.run(["git", "clean", "-xdff"], check=False, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT).stdout.decode(errors="ignore")) return # copying @@ -84,6 +89,9 @@ def build(pkgbuild: str, repo: str, todo: dict) -> None: os.path.join(config["basedir"]["repo"], repo, "os", config["arch"] + "/")) shutil.copy2(pkg, os.path.join(config["basedir"]["repo"], repo, "os", config["arch"] + "/")) + logging.debug("[GIT] %s", subprocess.run(["git", "clean", "-xdff"], check=False, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT).stdout.decode(errors="ignore")) + # repo logging.debug("[%s/%s/%s] Adding packages to todo list: %s", process_name, repo, name, ", ".join(glob.glob("*.pkg.tar.zst"))) @@ -237,7 +245,7 @@ def update_svn2git() -> None: errors="ignore")) else: os.chdir(git_path) - logging.debug("[GIT] %s", subprocess.run(["git", "clean", "-xdf"], check=False, stdout=subprocess.PIPE, + logging.debug("[GIT] %s", subprocess.run(["git", "clean", "-xdff"], check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode(errors="ignore")) logging.debug("[GIT] %s", subprocess.run(["git", "reset", "--hard"], check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode(errors="ignore"))