1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 09:56:13 +01:00

osc build: add --userootforbuild option

This commit is contained in:
Dr. Peter Poeml 2007-05-14 08:29:50 +00:00
parent 59cf753cc8
commit c895de414e
2 changed files with 7 additions and 1 deletions

View File

@ -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,

View File

@ -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