From 9ba0d8adcd3c3ec18cf467d0ed4b796f632d7439 Mon Sep 17 00:00:00 2001 From: Matthew D Date: Fri, 21 Feb 2020 20:08:37 -0500 Subject: [PATCH] Fix -n / --name flag on importsrcpkg command. osc importsrcpkg -n 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 --- osc/commandline.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osc/commandline.py b/osc/commandline.py index 44694999..fcd52cac 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -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: