From 175a44bc97338fb29168e9236d3a705c52861e5e Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Tue, 13 Sep 2022 16:15:59 +0200 Subject: [PATCH] Fix calling findpacs() with os.curdir A list of strings is expected, but a string was passed. It was working only by coincidence, because iterating through ["."] and "." gives the same result. --- osc/build.py | 2 +- osc/commandline.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osc/build.py b/osc/build.py index 482fea50..60e95f4b 100644 --- a/osc/build.py +++ b/osc/build.py @@ -1130,7 +1130,7 @@ def main(apiurl, opts, argv): if not old_pkg_dir.startswith('/') and not opts.offline: data = [prj, pacname, repo, arch] if old_pkg_dir == '_link': - p = core.findpacs(os.curdir)[0] + p = core.findpacs([os.curdir])[0] if not p.islink(): raise oscerr.WrongOptions('package is not a link') data[0] = p.linkinfo.project diff --git a/osc/commandline.py b/osc/commandline.py index 13507b53..a89355be 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1395,7 +1395,7 @@ class Osc(cmdln.Cmdln): elif len(args) <= 2: # try using the working copy at hand - p = findpacs(os.curdir)[0] + p = findpacs([os.curdir])[0] src_project = p.prjname src_package = p.name if self.options.apiurl and self.options.apiurl != p.apiurl: @@ -1627,7 +1627,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. elif len(args) <= 2: # try using the working copy at hand - p = findpacs(os.curdir)[0] + p = findpacs([os.curdir])[0] src_project = p.prjname src_package = p.name if len(args) == 0 and p.islink(): @@ -2742,7 +2742,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. rev = None if len(args) == 0: - p = findpacs(os.curdir)[0] + p = findpacs([os.curdir])[0] project = p.prjname package = p.name apiurl = p.apiurl