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/mmdebstrap.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mdbp/mmdebstrap.py') 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, -- cgit v1.2.3