summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPawel Hajdan, Jr <phajdan.jr@gentoo.org>2013-02-28 05:50:06 +0100
committerPawel Hajdan, Jr <phajdan.jr@gentoo.org>2013-02-28 05:50:06 +0100
commit3c20e14c939bf0efa495dead6243f8035d699b86 (patch)
treeafa721f1895a0968aebdba1bd6b3a2460ad5eb2e /stabilization-candidates.py
parentAdd xfce to list of stabilization bugs excludes. (diff)
downloadarch-tools-3c20e14c939bf0efa495dead6243f8035d699b86.tar.gz
arch-tools-3c20e14c939bf0efa495dead6243f8035d699b86.tar.bz2
arch-tools-3c20e14c939bf0efa495dead6243f8035d699b86.zip
Stabilization candidates: split out the bug filing script.
Diffstat (limited to 'stabilization-candidates.py')
-rwxr-xr-xstabilization-candidates.py66
1 files changed, 31 insertions, 35 deletions
diff --git a/stabilization-candidates.py b/stabilization-candidates.py
index 20dae63..615e3b6 100755
--- a/stabilization-candidates.py
+++ b/stabilization-candidates.py
@@ -24,8 +24,8 @@ if __name__ == "__main__":
parser.add_option("--days", dest="days", type=int, default=30, help="Number of days in the tree after stabilization is possible.")
parser.add_option("--repo", dest="repo", help="Path to portage CVS repository")
parser.add_option("--category", dest="category", help="Portage category filter (default is all categories)")
- parser.add_option("--file-bugs", dest="file_bugs", action="store_true", default=False, help="File stabilization bugs for detected candidates. Otherwise (default) the candidates are just displayed.")
parser.add_option("--exclude", dest="exclude", default=".*(kde-base|sci|lisp|perl-core|virtual|gnome|ruby|x11|mono|dotnet|games|xfce).*", help="Regular expression for excluded packages.")
+ parser.add_option("-o", "--output", dest="output_filename", default="stabilization-candidates.txt", help="Output filename for generated stabilization candidates list.")
(options, args) = parser.parse_args()
if not options.arch:
@@ -46,8 +46,33 @@ if __name__ == "__main__":
if options.category and not cp.startswith(options.category + "/"):
continue
- if options.exclude and re.match(options.exclude, cp):
+ cvs_path = os.path.join(options.repo, cp)
+ try:
+ metadata = MetaDataXML(os.path.join(cvs_path, 'metadata.xml'), '/usr/portage/metadata/herds.xml')
+ except IOError:
continue
+ maintainer_split = metadata.format_maintainer_string().split(' ', 1)
+ maintainer = maintainer_split[0]
+ if len(maintainer_split) > 1:
+ other_maintainers = maintainer_split[1].split(',')
+ else:
+ other_maintainers = []
+
+ if options.exclude:
+ if re.match(options.exclude, cp):
+ continue
+
+ if re.match(options.exclude, maintainer):
+ continue
+
+ skip = False
+ for m in other_maintainers:
+ if re.match(options.exclude, m):
+ skip = True
+ break
+ if skip:
+ continue
+
best_stable = portage.versions.best(portage.portdb.match(cp))
if not best_stable:
@@ -129,7 +154,6 @@ if __name__ == "__main__":
print 'version has bugs'
continue
- cvs_path = os.path.join(options.repo, cp)
ebuild_name = portage.versions.catsplit(best_candidate)[1] + ".ebuild"
ebuild_path = os.path.join(cvs_path, ebuild_name)
manifest_path = os.path.join(cvs_path, 'Manifest')
@@ -155,35 +179,7 @@ if __name__ == "__main__":
f.write(manifest_contents)
f.close()
- metadata = MetaDataXML(os.path.join(cvs_path, 'metadata.xml'), '/usr/portage/metadata/herds.xml')
- maintainer_split = metadata.format_maintainer_string().split(' ', 1)
- maintainer = maintainer_split[0]
- if len(maintainer_split) > 1:
- other_maintainers = maintainer_split[1].split(',')
- else:
- other_maintainers = []
- url = 'http://packages.gentoo.org/package/%s?arches=linux' % urllib.quote(cp)
-
- if options.file_bugs:
- description = ('Is it OK to stabilize =%s ?\n\n' % best_candidate +
- 'If so, please CC all arches which have stable keywords\n\n' +
- 'for older versions of this package and add STABLEREQ keyword\n\n' +
- 'to the bug.')
- params = {}
- 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'
- try:
- bug_id = bugzilla.Bug.create(params)['id']
- print 'Submitted bug #%d for %s. ;-)' % (bug_id, best_candidate)
- except xmlrpclib.Fault, f:
- print f
- print 'Failed to submit bug for %s. :-(' % best_candidate
- else:
- print (best_candidate, maintainer, other_maintainers)
+ with open(options.output_filename, 'a') as f:
+ f.write('# %s %s\n' % (maintainer, ', '.join(other_maintainers)))
+ f.write('%s\n' % best_candidate)
+ print (best_candidate, maintainer, other_maintainers)