From c895de414e3606d5a6df4d39a923a9fb84cd7c5a Mon Sep 17 00:00:00 2001 From: "Dr. Peter Poeml" Date: Mon, 14 May 2007 08:29:50 +0000 Subject: [PATCH] osc build: add --userootforbuild option --- osc/build.py | 4 +++- osc/commandline.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osc/build.py b/osc/build.py index cdf62cb9..41d44d59 100644 --- a/osc/build.py +++ b/osc/build.py @@ -212,6 +212,8 @@ def main(opts, argv): spec = argv[2] buildargs = [] + if not opts.userootforbuild: + buildargs.append('--norootforbuild') if opts.clean: buildargs.append('--clean') if opts.noinit: @@ -314,7 +316,7 @@ def main(opts, argv): print 'Running build' - cmd = '%s --root=%s --norootforbuild --rpmlist=%s --dist=%s %s %s' \ + cmd = '%s --root=%s --rpmlist=%s --dist=%s %s %s' \ % (config['build-cmd'], config['build-root'], rpmlist_file.name, diff --git a/osc/commandline.py b/osc/commandline.py index 360bab23..b472f6bd 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1062,6 +1062,10 @@ class Osc(cmdln.Cmdln): help='Save built packages into this directory') @cmdln.option('-x', '--extra-pkgs', metavar='PAC', action='append', help='Add this package when installing the build-root') + @cmdln.option('--userootforbuild', action='store_true', + help='Run build as root. The default is to build as ' + 'unprivileged user. Note that a line "# norootforbuild" ' + 'in the spec file will invalidate this option.') def do_build(self, subcmd, opts, *args): """${cmd_name}: Build a package on your local machine