mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 09:56:13 +01:00
- implement --no-checks for osc build
- make osc submitreq succeed for submitting new packages (previously the develproject check caused it to abort prematurely)
This commit is contained in:
parent
12ff5ac124
commit
048414088f
@ -242,6 +242,8 @@ def main(opts, argv):
|
||||
buildargs.append('--clean')
|
||||
if opts.noinit:
|
||||
buildargs.append('--noinit')
|
||||
if opts.nochecks:
|
||||
buildargs.append('--no-checks')
|
||||
if not opts.no_changelog:
|
||||
buildargs.append('--changelog')
|
||||
if opts.jobs:
|
||||
|
@ -521,17 +521,25 @@ class Osc(cmdln.Cmdln):
|
||||
|
||||
# create
|
||||
if cmd == 'create':
|
||||
devloc = show_develproject(apiurl, dst_project, dst_package)
|
||||
if devloc \
|
||||
and dst_project != devloc \
|
||||
and src_project != devloc \
|
||||
and not opts.nodevelproject:
|
||||
print """\
|
||||
if not opts.nodevelproject:
|
||||
devloc = None
|
||||
try:
|
||||
devloc = show_develproject(apiurl, dst_project, dst_package)
|
||||
except oscerr.APIError, e:
|
||||
print >>sys.stderr, """\
|
||||
Warning: failed to fetch meta data for '%s' package '%s' (new package?) """ \
|
||||
% (dst_project, dst_package)
|
||||
pass
|
||||
|
||||
if devloc \
|
||||
and dst_project != devloc \
|
||||
and src_project != devloc:
|
||||
print """\
|
||||
Sorry, but a different project, %s, is defined as the place where development
|
||||
of the package %s primarily takes place.
|
||||
Please submit there instead, or use --nodevelproject to force direct submission.""" \
|
||||
% (devloc, dst_package)
|
||||
sys.exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
result = create_submit_request(apiurl,
|
||||
src_project, src_package,
|
||||
@ -1700,6 +1708,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
help='don\'t update the package changelog from a changes file')
|
||||
@cmdln.option('--noinit', '--no-init', action='store_true',
|
||||
help='Skip initialization of build root and start with build immediately.')
|
||||
@cmdln.option('--nochecks', '--no-checks', action='store_true',
|
||||
help='Do not run post build checks on the resulting packages.')
|
||||
@cmdln.option('--no-verify', action='store_true',
|
||||
help='Skip signature verification of packages used for build.')
|
||||
@cmdln.option('-p', '--prefer-pkgs', metavar='DIR', action='append',
|
||||
|
@ -1573,7 +1573,7 @@ def show_package_meta(apiurl, prj, pac):
|
||||
return f.readlines()
|
||||
except urllib2.HTTPError, e:
|
||||
e.osc_msg = 'Error getting meta for project \'%s\' package \'%s\'' % (prj, pac)
|
||||
raise
|
||||
raise oscerr.APIError(e.osc_msg)
|
||||
|
||||
|
||||
def show_develproject(apiurl, prj, pac):
|
||||
|
Loading…
Reference in New Issue
Block a user