From a8f14bed609f4836788606720d3b5e973c820a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 2 May 2013 10:50:05 +0200 Subject: [PATCH] - allow to set bugowner/maintainership for a given binary --- NEWS | 2 ++ osc/commandline.py | 13 +++++++++++++ osc/core.py | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index e8340386..6258ac69 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ 0.140 - allow specifying directories as mv targets - drop the support for deprecated cbinstall and cbpreinstall directives + - allow to set maintainer or bugowner ship for a binary package initially, but ask back if + this is the right place. 0.139 - various bugfixes for owner search diff --git a/osc/commandline.py b/osc/commandline.py index 0b028456..38a65c89 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6872,6 +6872,19 @@ Please submit there instead, or use --nodevelproject to force direct submission. filterroles=None if binary: searchresult = owner(apiurl, binary, "binary", usefilter=filterroles, devel=None, limit=limit) + if not searchresult and (opts.set_bugowner or opts.set_bugowner_request): + # filtered search did not succeed, but maybe we want to set an owner initially? + searchresult = owner(apiurl, binary, "binary", usefilter="", devel=None, limit=-1) + if searchresult: + print("WARNING: the binary exists, but has no matching maintainership roles defined.") + print("Do you want to set it in the container where the binary appeared first?") + result = searchresult.find('owner') + print("This is: " + result.get('project'), end=' ') + if result.get('package'): + print (" / " + result.get('package')) + repl = raw_input('\nUse this this container? (y/n) ') + if repl.lower() != 'y': + searchresult = None elif opts.user: searchresult = owner(apiurl, opts.user, "user", usefilter=filterroles, devel=None) elif opts.group: diff --git a/osc/core.py b/osc/core.py index 10e591f4..cd9cc65a 100644 --- a/osc/core.py +++ b/osc/core.py @@ -5803,7 +5803,7 @@ def owner(apiurl, binary, mode="binary", attribute=None, project=None, usefilter query['devel'] = devel if limit != None: query['limit'] = limit - if usefilter: + if usefilter != None: query['filter'] = ",".join(usefilter) u = makeurl(apiurl, [ 'search', 'owner' ], query) res = None