From 9c4f0d5d30f264aae08e757f6a342f2a45f55312 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Wed, 7 Feb 2018 14:35:35 +0100 Subject: [PATCH] Ignore "--alternative-project " if it is equal to the wc's project Without this change, using "--alternative-project " in combination with "--multibuild-package " yields to unexpected results (from a user's point of view). Note that this may break existing (artificial) workflows (e.g., using --alternative-project to ignore the package meta's debuginfo flag), but these workflows should be rare and there are options to achieve the same. Fixes: #376 ("osc build -M something does not work with --alternative-project") --- osc/commandline.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osc/commandline.py b/osc/commandline.py index 4eee515b..54b062e4 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6170,6 +6170,14 @@ Please submit there instead, or use --nodevelproject to force direct submission. if len(args) > 3: raise oscerr.WrongArgs('Too many arguments') + project = None + try: + project = store_read_project(os.curdir) + except oscerr.NoWorkingCopy: + pass + if project == opts.alternative_project: + opts.alternative_project = None + args = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project, False, opts.vm_type, opts.multibuild_package) # check for source services