mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 02:16:12 +01:00
osc build: add --userootforbuild option
This commit is contained in:
parent
59cf753cc8
commit
c895de414e
@ -212,6 +212,8 @@ def main(opts, argv):
|
|||||||
spec = argv[2]
|
spec = argv[2]
|
||||||
|
|
||||||
buildargs = []
|
buildargs = []
|
||||||
|
if not opts.userootforbuild:
|
||||||
|
buildargs.append('--norootforbuild')
|
||||||
if opts.clean:
|
if opts.clean:
|
||||||
buildargs.append('--clean')
|
buildargs.append('--clean')
|
||||||
if opts.noinit:
|
if opts.noinit:
|
||||||
@ -314,7 +316,7 @@ def main(opts, argv):
|
|||||||
|
|
||||||
print 'Running build'
|
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-cmd'],
|
||||||
config['build-root'],
|
config['build-root'],
|
||||||
rpmlist_file.name,
|
rpmlist_file.name,
|
||||||
|
@ -1062,6 +1062,10 @@ class Osc(cmdln.Cmdln):
|
|||||||
help='Save built packages into this directory')
|
help='Save built packages into this directory')
|
||||||
@cmdln.option('-x', '--extra-pkgs', metavar='PAC', action='append',
|
@cmdln.option('-x', '--extra-pkgs', metavar='PAC', action='append',
|
||||||
help='Add this package when installing the build-root')
|
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):
|
def do_build(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Build a package on your local machine
|
"""${cmd_name}: Build a package on your local machine
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user