From a6b515fc6fd3bf1800797ec9b75ae2dcd9eca565 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 19 Apr 2012 16:00:06 +0200 Subject: --- stabilization-candidates.py | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/stabilization-candidates.py b/stabilization-candidates.py index 1a7211c..d4c82b9 100755 --- a/stabilization-candidates.py +++ b/stabilization-candidates.py @@ -10,14 +10,12 @@ import re import subprocess import urllib -import bugz.bugzilla +from bugz.bugzilla import BugzillaProxy from portage.package.ebuild.getmaskingstatus import getmaskingstatus from portage.xml.metadata import MetaDataXML import portage.versions -class MyBugz(bugz.bugzilla.Bugz): - def get_input(self, prompt): - return raw_input(prompt) +from common import login if __name__ == "__main__": parser = optparse.OptionParser() @@ -37,10 +35,10 @@ if __name__ == "__main__": if args: parser.error("unrecognized command-line args") - url = 'https://bugs.gentoo.org' - print 'You may be prompted for your Gentoo Bugzilla username and password (%s).' % url - bugzilla = MyBugz(url) - bugzilla.auth() + url = 'https://bugs.gentoo.org/xmlrpc.cgi' + print 'You will be prompted for your Gentoo Bugzilla username and password (%s).' % url + bugzilla = BugzillaProxy(url) + login(bugzilla) final_candidates = [] now = datetime.datetime.now() @@ -137,13 +135,16 @@ if __name__ == "__main__": f.close() # Do not risk trying to stabilize a package with known bugs. - bugs = bugzilla.search(cp, status=None) - if bugs: + params = {} + params['summary'] = [cp]; + bugs = bugzilla.Bug.search(params) + if len(bugs['bugs']): continue # Protection against filing a stabilization bug twice. - bugs = bugzilla.search(best_candidate) - if bugs: + params['summary'] = [best_candidate] + bugs = bugzilla.Bug.search(params) + if len(bugs['bugs']): continue metadata = MetaDataXML(os.path.join(cvs_path, 'metadata.xml'), '/usr/portage/metadata/herds.xml') @@ -165,17 +166,16 @@ if __name__ == "__main__": description = ('Is it OK to stabilize =%s ?\n\n' % best_candidate + 'If so, please CC arches and add STABLEREQ keyword.\n\n' + 'Stabilization of this package has been repoman-checked on the following arches: %s' % ', '.join(options.arch)) - bug_id = bugzilla.post('Gentoo Linux', - 'Keywording and Stabilization', - 'Please stabilize =%s' % best_candidate, - description, - url=url, - assigned_to=maintainer, - cc=other_maintainers, - severity='enhancement') - if bug_id == 0: - print 'Submitting bug for %s failed. :-(' % best_candidate - else: - print 'Submitted bug #%d for %s. ;-)' % (bug_id, best_candidate) + params['product'] = 'Gentoo Linux' + params['version'] = 'unspecified' + params['component'] = 'Keywording and Stabilization' + params['summary'] = 'Please stabilize =%s' % best_candidate + params['description'] = description + params['url'] = url + params['assigned_to'] = maintainer + params['cc'] = other_maintainers + params['severity'] = 'enhancement' + bug_id = bugzilla.Bug.create(params)['id'] + print 'Submitted bug #%d for %s. ;-)' % (bug_id, best_candidate) else: print (best_candidate, maintainer, other_maintainers) -- cgit v1.2.3-65-gdbad