Blob Blame History Raw
From f09b87050618cd39229491b2aa153cc488c1922a Mon Sep 17 00:00:00 2001
From: Neal Gompa <ngompa13@gmail.com>
Date: Thu, 30 May 2019 22:20:13 -0400
Subject: [PATCH] Do not attempt to run source services when --local-package is
 set

Since c39c3b8cae826723c23e5115e5c051438d7aa8ba, osc has accidentally refused
to permit local builds for package sources that are not from a working copy,
even when --local-package is passed in. This is because it attempts to
instantiate a Package() object, which fails because there's no osc working
copy to instantiate from.

Since any build passing --local-package probably can't run source services
anyway, let's restore the capability to build with it by having it skip
any attempt to run them automatically when the option is passed.
---
 osc/commandline.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/osc/commandline.py b/osc/commandline.py
index 0e3e695..da908da 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -6318,7 +6318,7 @@ 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)
 
         # check for source services
-        if not opts.offline and not opts.noservice:
+        if not opts.offline and not opts.noservice and not opts.local_package:
             p = Package('.')
             r = p.run_source_services(verbose=True)
             if r:
@@ -6326,7 +6326,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
                 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!')
+                   ' be executed. This may not be the same build as on server!')
             print(msg)
 
         if not opts.local_package:
-- 
2.21.0