diff options
author | Helmut Grohne <helmut@subdivi.de> | 2021-06-15 13:36:34 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2021-06-15 13:36:34 +0200 |
commit | 511c49acc13803d851a4d0d2ef17647e3e2144b4 (patch) | |
tree | 66604f5addb56b2502106ed1c764598aeea53d33 /mdbp/pbuilder.py | |
parent | d8b36aca8725b36411298961aa2494e995426417 (diff) | |
download | mdbp-511c49acc13803d851a4d0d2ef17647e3e2144b4.tar.gz |
allow passing custom options to pbuilder and sbuild
Diffstat (limited to 'mdbp/pbuilder.py')
-rw-r--r-- | mdbp/pbuilder.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/mdbp/pbuilder.py b/mdbp/pbuilder.py index a3eb228..09b6b59 100644 --- a/mdbp/pbuilder.py +++ b/mdbp/pbuilder.py @@ -10,12 +10,29 @@ import subprocess import sys import tempfile -from .common import buildjson, clean_dir, compute_env, get_dsc, make_option, \ - profile_option +from .common import AddSpaceSeparatedValues, buildjson, clean_dir, \ + compute_env, get_dsc, make_option, profile_option def main() -> None: """Entry point for mdbp-pbuilder backend""" parser = argparse.ArgumentParser() + parser.add_argument( + "--pbuilderopt", + dest="pbuilderopts", + action="append", + metavar="OPT", + default=[], + help="a custom option to be passed down to pbuilder, can be specified " + "multiple times and mixed with --pbuilderopts", + ) + parser.add_argument( + "--pbuilderopts", + action=AddSpaceSeparatedValues, + metavar="OPTS", + default=[], + help="space-separated options to be passed down to pbuilder, can be " + "specified multiple times and mixed with --pbuilderopt", + ) parser.add_argument("buildjson", type=buildjson) args = parser.parse_args() build = args.buildjson @@ -78,7 +95,7 @@ set -e 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)]) + cmd.extend(["--hookdir", hookdirn, *args.pbuilderopts, str(dscpath)]) ret = subprocess.call(cmd, env=compute_env(build), stdout=None if enablelog else subprocess.DEVNULL, |