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/mmdebstrap.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/mmdebstrap.py')
-rw-r--r-- | mdbp/mmdebstrap.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mdbp/mmdebstrap.py b/mdbp/mmdebstrap.py index 18dfc31..aa1f461 100644 --- a/mdbp/mmdebstrap.py +++ b/mdbp/mmdebstrap.py @@ -16,8 +16,8 @@ import subprocess import sys import typing -from .common import buildjson, compute_env, download_dsc, get_dsc_files, \ - json_load, profile_option +from .common import buildjson, clean_dir, compute_env, download_dsc, \ + get_dsc_files, json_load, profile_option libc = ctypes.CDLL(ctypes.util.find_library("c")) def unshare_network() -> None: @@ -117,6 +117,7 @@ def hook_main(buildjsonfilename: str, chrootname: str) -> None: priv_drop(["lintian", *build["lintian"].get("options", ()), "%s_%s.changes" % (dscpath.stem, hostarch)], chroot=chroot, setuid="build", chdir=buildpath.parent) + clean_dir(fullbuildpath.parent, build["output"].get("artifacts", ["*"])) class RawStoreAction(argparse.Action): """An action that stores the raw value in addition to the type-parsed @@ -189,8 +190,9 @@ def main() -> None: if "dscpath" in build["input"] else ()), '--customize-hook=mdbp-mmdebstrap --hook-helper %s "$1"' % shlex.quote(args.raw_buildjson), - "--customize-hook=sync-out " + - shlex.join([str(buildpath.parent), build["output"]["directory"]]), + *(["--customize-hook=sync-out " + + shlex.join([str(buildpath.parent), build["output"]["directory"]])] + if build["output"].get("artifacts", ["*"]) else ()), build["distribution"], "/dev/null", args.mirror, |