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

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.
This commit is contained in:
Daniel Mach 2022-09-13 16:15:59 +02:00
parent 8dbf859ce2
commit 175a44bc97
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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