From 943a53d4d834ae9dba5fe18effea69c898697204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 16 Jan 2017 11:58:02 +0100 Subject: [PATCH] add unpublish command --- NEWS | 2 +- osc/commandline.py | 8 +++++++- osc/core.py | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 2519b71d..09b132aa 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ 0.157 - - + - add unpublish command (requires OBS 2.8) 0.156 - highlight scheduled jobs with dispatch problems (due to constraints) diff --git a/osc/commandline.py b/osc/commandline.py index 599af758..424b0254 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6658,6 +6658,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='Delete all binaries of packages which have dependency errors') @cmdln.option('--all', action='store_true', help='Delete all binaries regardless of the package status (previously default)') + @cmdln.alias("unpublish") def do_wipebinaries(self, subcmd, opts, *args): """${cmd_name}: Delete all binary packages of a certain project/package @@ -6667,6 +6668,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. usage: osc wipebinaries OPTS # works in checked out project dir osc wipebinaries OPTS PROJECT [PACKAGE] + osc unpublish OPTS # works in checked out project dir + osc unpublish OPTS PROJECT [PACKAGE] ${cmd_option_list} """ @@ -6711,7 +6714,10 @@ Please submit there instead, or use --nodevelproject to force direct submission. # make a new request for each code= parameter for code in codes: - print(wipebinaries(apiurl, project, package, opts.arch, opts.repo, code)) + if subcmd == 'unpublish': + print(unpublish(apiurl, project, package, opts.arch, opts.repo, code)) + else: + print(wipebinaries(apiurl, project, package, opts.arch, opts.repo, code)) @cmdln.option('-q', '--quiet', action='store_true', diff --git a/osc/core.py b/osc/core.py index f2f2cad2..b24ecccb 100644 --- a/osc/core.py +++ b/osc/core.py @@ -6256,6 +6256,9 @@ def abortbuild(apiurl, project, package=None, arch=None, repo=None): def restartbuild(apiurl, project, package=None, arch=None, repo=None): return cmdbuild(apiurl, 'restartbuild', project, package, arch, repo) +def unpublish(apiurl, project, package=None, arch=None, repo=None, code=None): + return cmdbuild(apiurl, 'unpublish', project, package, arch, repo, code) + def wipebinaries(apiurl, project, package=None, arch=None, repo=None, code=None): return cmdbuild(apiurl, 'wipe', project, package, arch, repo, code)