1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-28 10:46:15 +01:00

Merge pull request #691 from adrianschroeter/noinit

"osc shell" uses --noinit by default now if buildroot exists
This commit is contained in:
Marco Strigl 2019-12-02 14:52:42 +01:00 committed by GitHub
commit d5c313cc08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View File

@ -563,8 +563,6 @@ def main(apiurl, opts, argv):
buildargs.append('--norootforbuild')
if opts.clean:
buildargs.append('--clean')
if opts.noinit:
buildargs.append('--noinit')
if opts.nochecks:
buildargs.append('--no-checks')
if not opts.no_changelog:
@ -638,8 +636,6 @@ def main(apiurl, opts, argv):
if opts.multibuild_package:
buildargs.append('--buildflavor=%s' % opts.multibuild_package)
pac = pac + ":" + opts.multibuild_package
if opts.shell:
buildargs.append("--shell")
if opts.wipe:
buildargs.append("--wipe")
@ -675,6 +671,15 @@ def main(apiurl, opts, argv):
except:
pass
if opts.shell:
buildargs.append("--shell")
if os.path.exists(build_root) and not opts.clean:
opts.noinit = True
opts.offline = True
if opts.noinit:
buildargs.append('--noinit')
cache_dir = config['packagecachedir'] % {'apihost': apihost}
extra_pkgs = []

View File

@ -6291,7 +6291,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='define macro X with value Y')
@cmdln.option('--build-opt', metavar='OPT', action='append',
help='pass option OPT to the build command')
@cmdln.option('--userootforbuild', action='store_true',
@cmdln.option('--userootforbuild', '--login-as-root', action='store_true',
help='Run build or shell as root. The default is to build as '
'unprivileged user. Note that a line "# norootforbuild" '
'in the spec file will invalidate this option.')
@ -6477,6 +6477,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.offline and opts.preload:
raise oscerr.WrongOptions('--offline and --preload are mutually exclusive')
if opts.shell or opts.wipe:
opts.noservice = True
if opts.preload:
opts.nopreinstallimage = True