diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-05-27 11:54:04 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-05-27 11:54:04 +0200 |
commit | 69fdfcdda423b55c7251e4d46e82563cda98a63d (patch) | |
tree | 4299a69f4ae7461065f3f1bb48ac9f2ba557f058 /mdbp/pbuilder.py | |
parent | afff0dc73188ac323ec0265cc6b39c67f9fd7474 (diff) | |
download | mdbp-69fdfcdda423b55c7251e4d46e82563cda98a63d.tar.gz |
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.
Diffstat (limited to 'mdbp/pbuilder.py')
-rw-r--r-- | mdbp/pbuilder.py | 16 |
1 files changed, 9 insertions, 7 deletions
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() |