mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 10:36:17 +01:00
- added --build-failed and --broken options to the do_wipebinaries()
method (this also fixes bug/enhancement #335498)
This commit is contained in:
parent
0daff74b79
commit
42e128687d
@ -1558,6 +1558,10 @@ class Osc(cmdln.Cmdln):
|
|||||||
help='Delete all binary packages for a specific repository')
|
help='Delete all binary packages for a specific repository')
|
||||||
@cmdln.option('--build-disabled', action='store_true',
|
@cmdln.option('--build-disabled', action='store_true',
|
||||||
help='Delete all binaries of packages for which the build is disabled')
|
help='Delete all binaries of packages for which the build is disabled')
|
||||||
|
@cmdln.option('--build-failed', action='store_true',
|
||||||
|
help='Delete all binaries of packages for which the build failed')
|
||||||
|
@cmdln.option('--broken', action='store_true',
|
||||||
|
help='Delete all binaries of packages for which the package source is bad')
|
||||||
def do_wipebinaries(self, subcmd, opts, *args):
|
def do_wipebinaries(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Delete all binary packages of a certain project/package
|
"""${cmd_name}: Delete all binary packages of a certain project/package
|
||||||
|
|
||||||
@ -1579,8 +1583,21 @@ class Osc(cmdln.Cmdln):
|
|||||||
package = args[1]
|
package = args[1]
|
||||||
else:
|
else:
|
||||||
package = None
|
package = None
|
||||||
|
|
||||||
print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo, opts.build_disabled)
|
codes = []
|
||||||
|
if opts.build_disabled:
|
||||||
|
codes.append('disabled')
|
||||||
|
if opts.build_failed:
|
||||||
|
codes.append('failed')
|
||||||
|
if opts.broken:
|
||||||
|
codes.append('broken')
|
||||||
|
|
||||||
|
if len(codes) == 0:
|
||||||
|
codes.append(None)
|
||||||
|
|
||||||
|
# make a new request for each code= parameter
|
||||||
|
for code in codes:
|
||||||
|
print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo, code)
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('--repos-baseurl', action='store_true',
|
@cmdln.option('--repos-baseurl', action='store_true',
|
||||||
|
10
osc/core.py
10
osc/core.py
@ -1815,7 +1815,7 @@ def abortbuild(apiurl, project, package=None, arch=None, repo=None):
|
|||||||
return root.get('code')
|
return root.get('code')
|
||||||
|
|
||||||
|
|
||||||
def wipebinaries(apiurl, project, package=None, arch=None, repo=None, build_disabled=None):
|
def wipebinaries(apiurl, project, package=None, arch=None, repo=None, code=None):
|
||||||
query = []
|
query = []
|
||||||
query.append('cmd=wipe')
|
query.append('cmd=wipe')
|
||||||
if package:
|
if package:
|
||||||
@ -1824,8 +1824,8 @@ def wipebinaries(apiurl, project, package=None, arch=None, repo=None, build_disa
|
|||||||
query.append('arch=%s' % quote_plus(arch))
|
query.append('arch=%s' % quote_plus(arch))
|
||||||
if repo:
|
if repo:
|
||||||
query.append('repository=%s' % quote_plus(repo))
|
query.append('repository=%s' % quote_plus(repo))
|
||||||
if build_disabled:
|
if code:
|
||||||
query.append('code=disabled')
|
query.append('code=%s' % quote_plus(code))
|
||||||
|
|
||||||
u = makeurl(apiurl, ['build', project], query)
|
u = makeurl(apiurl, ['build', project], query)
|
||||||
try:
|
try:
|
||||||
@ -1838,8 +1838,8 @@ def wipebinaries(apiurl, project, package=None, arch=None, repo=None, build_disa
|
|||||||
err_str += ' arch %s' % arch
|
err_str += ' arch %s' % arch
|
||||||
if repo:
|
if repo:
|
||||||
err_str += ' repository %s' % repo
|
err_str += ' repository %s' % repo
|
||||||
if build_disabled:
|
if code:
|
||||||
err_str += ' code=disabled'
|
err_str += ' code=%s' % code
|
||||||
print >> sys.stderr, err_str
|
print >> sys.stderr, err_str
|
||||||
print >> sys.stderr, u
|
print >> sys.stderr, u
|
||||||
print >> sys.stderr, e
|
print >> sys.stderr, e
|
||||||
|
Loading…
Reference in New Issue
Block a user