summaryrefslogtreecommitdiff
path: root/mdbp/mmdebstrap.py
diff options
context:
space:
mode:
Diffstat (limited to 'mdbp/mmdebstrap.py')
-rw-r--r--mdbp/mmdebstrap.py10
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,