1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 09:56:13 +01:00

wipebinaries: allow to wipe all binaries of packages for which the build is disabled

This commit is contained in:
Dr. Peter Poeml 2007-07-04 14:57:19 +00:00
parent d7985774b4
commit 9ee07fcd5a
2 changed files with 9 additions and 3 deletions

View File

@ -1385,9 +1385,11 @@ class Osc(cmdln.Cmdln):
@cmdln.option('-a', '--arch', metavar='ARCH',
help='Delete all binary package for a specific architecture')
help='Delete all binary packages for a specific architecture')
@cmdln.option('-r', '--repo', metavar='REPO',
help='Delete all binary packages for a specific repository')
@cmdln.option('--build-disabled', action='store_true',
help='Delete all binaries of packages for which the build is disabled')
def do_wipebinaries(self, subcmd, opts, *args):
"""${cmd_name}: Delete all binary packages of a certain project/package
@ -1410,7 +1412,7 @@ class Osc(cmdln.Cmdln):
else:
package = None
print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo)
print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo, opts.build_disabled)

View File

@ -1583,7 +1583,7 @@ def abortbuild(apiurl, project, package=None, arch=None, repo=None):
return root.get('code')
def wipebinaries(apiurl, project, package=None, arch=None, repo=None):
def wipebinaries(apiurl, project, package=None, arch=None, repo=None, build_disabled=None):
query = []
query.append('cmd=wipe')
if package:
@ -1592,6 +1592,8 @@ def wipebinaries(apiurl, project, package=None, arch=None, repo=None):
query.append('arch=%s' % quote_plus(arch))
if repo:
query.append('repository=%s' % quote_plus(repo))
if build_disabled:
query.append('code=disabled')
u = makeurl(apiurl, ['build', project], query)
try:
@ -1604,6 +1606,8 @@ def wipebinaries(apiurl, project, package=None, arch=None, repo=None):
err_str += ' arch %s' % arch
if repo:
err_str += ' repository %s' % repo
if build_disabled:
err_str += ' code=disabled'
print >> sys.stderr, err_str
print >> sys.stderr, u
print >> sys.stderr, e