From 9849112278afd36b4b8c4881a3d9bd3606c39fc5 Mon Sep 17 00:00:00 2001 From: lethliel Date: Wed, 22 Jan 2020 14:24:58 +0100 Subject: [PATCH] append --norootforbuild as default pass opts to run_build and check if norootforbuild needs to be appended to cmd. (if opts.userootforbuild is not set) --- osc/build.py | 4 +++- osc/commandline.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/osc/build.py b/osc/build.py index 13093936..e27d5bc7 100644 --- a/osc/build.py +++ b/osc/build.py @@ -537,7 +537,7 @@ def calculate_build_root(apihost, prj, pac, repo, arch): % {'repo': repo, 'arch': arch, 'project': prj, 'package': pac, 'apihost': apihost} return buildroot -def run_build(*args): +def run_build(opts, *args): cmd = [config['build-cmd']] cmd += args @@ -548,6 +548,8 @@ def run_build(*args): cmd = sucmd + ['-s', cmd[0], 'root', '--'] + cmd[1:] else: cmd = sucmd + cmd + if not opts.userootforbuild: + cmd.append('--norootforbuild') return run_external(cmd[0], *cmd[1:]) def main(apiurl, opts, argv): diff --git a/osc/commandline.py b/osc/commandline.py index a339f918..726ee424 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6470,7 +6470,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. build_args = ['--root=' + build_root, '--noinit', '--shell'] if opts.wipe: build_args.append('--wipe') - sys.exit(osc.build.run_build(*build_args)) + sys.exit(osc.build.run_build(opts, *build_args)) elif subcmd in ('shell', 'chroot') or opts.shell: print('--shell in combination with build-type %s is experimental.' % vm_chroot) print('The semantics may change at any time!')