1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

Fix -n / --name flag on importsrcpkg command.

osc importsrcpkg -n <pacname> does not work.  If the option is supplied, osc
mistakenly trys to "decode" the pac object.  This patch limit the decode
call when pac is not a string.

Refactored fix based on suggestions from marcus-h
This commit is contained in:
Matthew D 2020-02-21 20:08:37 -05:00
parent 20f2f40614
commit 9ba0d8adcd

View File

@ -7900,6 +7900,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
title = opts.title
if opts.name:
pac = opts.name
elif pac is not None:
pac = pac.decode()
if opts.description:
descr = opts.description
@ -7908,7 +7910,6 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print('please specify a package name with the \'--name\' option. ' \
'The automatic detection failed', file=sys.stderr)
sys.exit(1)
pac = pac.decode()
if conf.config['do_package_tracking']:
createPackageDir(os.path.join(project.dir, pac), project)
else: