1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-23 05:26:16 +01:00

add unpublish command

This commit is contained in:
Adrian Schröter 2017-01-16 11:58:02 +01:00
parent 4c39b63162
commit 943a53d4d8
3 changed files with 11 additions and 2 deletions

2
NEWS
View File

@ -1,5 +1,5 @@
0.157
-
- add unpublish command (requires OBS 2.8)
0.156
- highlight scheduled jobs with dispatch problems (due to constraints)

View File

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

View File

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