1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

Cleanup the source services execution code in do_build

Always error out if the source services execution failed (the old
code only errored out if the local_service_run config option was
set (this behavior was probably unintentionally introduced in commit
d3dd8539d9 ('- fallback to "build
--local-package" if it does not exist instead of complaining'))).
Also, do not suppress all exceptions (if something failed in the
services execution code path, the user should be informed).

The bug was reported by darix.
This commit is contained in:
Marcus Huewe 2019-02-22 15:42:23 +01:00
parent 93ea66b922
commit c39c3b8cae

View File

@ -6291,14 +6291,16 @@ Please submit there instead, or use --nodevelproject to force direct submission.
args = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project, False, opts.vm_type, opts.multibuild_package) args = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project, False, opts.vm_type, opts.multibuild_package)
# check for source services # check for source services
r = None
try:
if not opts.offline and not opts.noservice: if not opts.offline and not opts.noservice:
p = Package('.') p = Package('.')
r = p.run_source_services(verbose=True) r = p.run_source_services(verbose=True)
except: if r:
print("WARNING: package is not existing on server yet") print('Source service run failed!', file=sys.stderr)
opts.local_package = True sys.exit(1)
else:
msg = ('WARNING: source services from package or project will not'
'be executed. This may not be the same build as on server!')
print(msg)
if not opts.local_package: if not opts.local_package:
try: try:
@ -6311,15 +6313,6 @@ Please submit there instead, or use --nodevelproject to force direct submission.
except oscerr.NoWorkingCopy: except oscerr.NoWorkingCopy:
pass pass
if opts.offline or opts.local_package or r == None:
print("WARNING: source service from package or project will not be executed. This may not be the same build as on server!")
elif (conf.config['local_service_run'] and not opts.noservice) and not opts.noinit:
if r != 0:
print('Source service run failed!', file=sys.stderr)
sys.exit(1)
# that is currently unreadable on cli, we should not have a backtrace on standard errors:
#raise oscerr.ServiceRuntimeError('Service run failed: \'%s\'', r)
if conf.config['no_verify']: if conf.config['no_verify']:
opts.no_verify = True opts.no_verify = True