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

Don't run source services when building outside of an OSC package working copy

When building a package from a directory that is not a checked-out
OBS working, the error message:
"Error: "<directory>" is not an osc package working copy."
is generated.
This occurs when build.main() attempts to run source services which
is probably not a good idea as these are part of the core.Package
infrastructure which cannot be initialized for such packages.

It is probably best to disable the source services in this case.
See Issue#936.

Suggested-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: Egbert Eich <eich@suse.com>
This commit is contained in:
Egbert Eich 2021-08-03 09:21:53 +02:00
parent e5dda8337c
commit b61b79cf85

View File

@ -790,6 +790,9 @@ def main(apiurl, opts, argv):
if opts.noinit:
buildargs.append('--noinit')
if not is_package_dir('.'):
opts.noservice = True
# check for source services
if not opts.offline and not opts.noservice:
p = osc.core.Package(os.curdir)