summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Hajdan, Jr <phajdan.jr@gentoo.org>2012-01-27 15:54:19 +0100
committerPawel Hajdan, Jr <phajdan.jr@gentoo.org>2012-01-27 15:54:19 +0100
commit8aff939c6831ac73eb6a6a4a07a6c475e15ed308 (patch)
treedb5239f2b4388bbb63bc40e382af68e909089a64 /maintainer-timeout.py
parentFix bugs related to empty lines handling. (diff)
downloadarch-tools-8aff939c6831ac73eb6a6a4a07a6c475e15ed308.tar.gz
arch-tools-8aff939c6831ac73eb6a6a4a07a6c475e15ed308.tar.bz2
arch-tools-8aff939c6831ac73eb6a6a4a07a6c475e15ed308.zip
Begin work on maintainer-timeout script.
Extract common parts to common.py Fix bug where only first 100 bug details were retrieved from Bugzilla.
Diffstat (limited to 'maintainer-timeout.py')
-rwxr-xr-xmaintainer-timeout.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/maintainer-timeout.py b/maintainer-timeout.py
new file mode 100755
index 0000000..c75edd6
--- /dev/null
+++ b/maintainer-timeout.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+# Copyright 2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import optparse
+
+import bugz.bugzilla
+import portage.versions
+
+from common import Bug, chunks
+
+
+class MyBugz(bugz.bugzilla.Bugz):
+ def get_input(self, prompt):
+ return raw_input(prompt)
+
+
+if __name__ == "__main__":
+ parser = optparse.OptionParser()
+ (options, args) = parser.parse_args()
+ 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, forget=True)
+ bugzilla.auth()
+
+ bugs = []
+ raw_bugs = bugzilla.search('please stabilize', reporter=bugzilla.user, status=None)
+ for chunk in chunks(raw_bugs, 100):
+ bugs += [Bug(xml) for xml in bugzilla.get([bug['bugid'] for bug in chunk]).findall("bug")]
+ for bug in bugs:
+ if 'STABLEREQ' in bug.keywords():
+ continue
+ arch_found = False
+ for arch in portage.archlist:
+ if '%s@gentoo.org' % arch in bug.cc():
+ arch_found = True
+ break
+ if arch_found:
+ continue
+ if len(bug.comments()) > 1:
+ continue
+ bug.detect_cpvs()
+ if len(bug.cpvs()) != 1:
+ continue
+ cp = portage.versions.cpv_getkey(bug.cpvs()[0])
+ for cpv in portage.portdb.cp_list(cp):
+ print portage.portdb.aux_get(cpv, ['KEYWORDS'])
+ print (bug.id_number(), bug.summary(), cp)