From 69fdfcdda423b55c7251e4d46e82563cda98a63d Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 27 May 2021 11:54:04 +0200 Subject: add new field .output.artifacts to schema Using the field you can specify an ORed set of positive glob-style patterns for artifacts to retain in the .output.directory. It defaults to including all artifacts. --- mdbp/pbuilder.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'mdbp/pbuilder.py') diff --git a/mdbp/pbuilder.py b/mdbp/pbuilder.py index 64d218d..269b220 100644 --- a/mdbp/pbuilder.py +++ b/mdbp/pbuilder.py @@ -10,7 +10,7 @@ import subprocess import sys import tempfile -from .common import buildjson, compute_env, get_dsc, make_option, \ +from .common import buildjson, clean_dir, compute_env, get_dsc, make_option, \ profile_option def main() -> None: @@ -79,12 +79,14 @@ runuser -u pbuilder -- lintian %s "${BUILDDIR:-/tmp/buildd}"/*.changes """ % (shlex.join(apt_get), shlex.join(build["lintian"].get("options", [])))) hook.chmod(0o755) cmd.extend(["--hookdir", hookdirn, str(dscpath)]) - proc = subprocess.Popen(cmd, env=compute_env(build), - stdout=None if enablelog - else subprocess.DEVNULL, - stderr=subprocess.STDOUT if enablelog - else subprocess.DEVNULL) - sys.exit(proc.wait()) + cproc = subprocess.run(cmd, env=compute_env(build), + stdout=None if enablelog + else subprocess.DEVNULL, + stderr=subprocess.STDOUT if enablelog + else subprocess.DEVNULL) + clean_dir(pathlib.Path(build["output"]["directory"]), + build["output"].get("artifacts", ["*"])) + sys.exit(cproc.returncode) if __name__ == "__main__": main() -- cgit v1.2.3