diff --git a/osc/commandline.py b/osc/commandline.py index ad69a7da..f6a8b52d 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -881,7 +881,10 @@ Please submit there instead, or use --nodevelproject to force direct submission. raise oscerr.WrongArgs('Missing argument.') for pkg in pkgs: - delete_package(conf.config['apiurl'], args[0], pkg) + # careful: if pkg is an empty string, the package delete request results + # into a project delete request - which works recursively... + if pkg: + delete_package(conf.config['apiurl'], args[0], pkg) @cmdln.option('-f', '--force', action='store_true', diff --git a/osc/core.py b/osc/core.py index c8968ad0..d78e3395 100755 --- a/osc/core.py +++ b/osc/core.py @@ -1300,9 +1300,13 @@ def is_package_dir(d): def slash_split(l): """Split command line arguments like 'foo/bar' into 'foo' 'bar'. This is handy to allow copy/paste a project/package combination in this form. + + Trailing slashes are removed before the split, because the split would + otherwise give an additional empty string. """ r = [] for i in l: + i = i.rstrip('/') r += i.split('/') return r