diff options
Diffstat (limited to 'mdbp/sbuild.py')
-rw-r--r-- | mdbp/sbuild.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/mdbp/sbuild.py b/mdbp/sbuild.py index ba42932..02aa6cf 100644 --- a/mdbp/sbuild.py +++ b/mdbp/sbuild.py @@ -10,7 +10,8 @@ import sys import tempfile import typing -from .common import buildjson, clean_dir, compute_env, get_dsc +from .common import AddSpaceSeparatedValues, buildjson, clean_dir, \ + compute_env, get_dsc PerlValue = typing.Union[None, str, typing.List[typing.Any], typing.Dict[str, typing.Any]] @@ -43,6 +44,23 @@ def perl_conf(conf: typing.Dict[str, PerlValue]) -> str: def main() -> None: """Entry point for mdbp-sbuild backend""" parser = argparse.ArgumentParser() + parser.add_argument( + "--sbuildopt", + dest="sbuildopts", + action="append", + metavar="OPT", + default=[], + help="a custom option to be passed down to sbuild, can be specified " + "multiple times and mixed with --sbuildopts", + ) + parser.add_argument( + "--sbuildopts", + action=AddSpaceSeparatedValues, + metavar="OPTS", + default=[], + help="space-separated options to be passed down to sbuild, can be " + "specified multiple times and mixed with --sbuildopt", + ) parser.add_argument("buildjson", type=buildjson) args = parser.parse_args() build = args.buildjson @@ -90,7 +108,7 @@ def main() -> None: except KeyError: thing = str(stack.enter_context(get_dsc(build)).absolute()) - ret = subprocess.call(["sbuild", thing], + ret = subprocess.call(["sbuild", *args.sbuildopts, thing], env=dict(SBUILD_CONFIG=sbuildconf.name, PATH="/usr/bin:/bin"), cwd=build["output"]["directory"], |