From 9ee07fcd5a1653bced33b1f126d8b35e3b3a584e Mon Sep 17 00:00:00 2001 From: "Dr. Peter Poeml" Date: Wed, 4 Jul 2007 14:57:19 +0000 Subject: [PATCH] wipebinaries: allow to wipe all binaries of packages for which the build is disabled --- osc/commandline.py | 6 ++++-- osc/core.py | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index cfc2843a..8c36d949 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -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) diff --git a/osc/core.py b/osc/core.py index beefe591..34068a29 100755 --- a/osc/core.py +++ b/osc/core.py @@ -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