From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RVo7F-000224-VS for garchives@archives.gentoo.org; Wed, 30 Nov 2011 17:38:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3F01121C02E; Wed, 30 Nov 2011 17:38:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id EBAB221C02E for ; Wed, 30 Nov 2011 17:38:32 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C60E21B401D for ; Wed, 30 Nov 2011 17:38:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 3A65D80044 for ; Wed, 30 Nov 2011 17:38:31 +0000 (UTC) From: "Paweł Hajdan" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Paweł Hajdan" Message-ID: Subject: [gentoo-commits] proj/arch-tools:master commit in: / X-VCS-Repository: proj/arch-tools X-VCS-Files: stabilization-candidates.py X-VCS-Directories: / X-VCS-Committer: phajdan.jr X-VCS-Committer-Name: Paweł Hajdan X-VCS-Revision: b41b45df8693af1b00b59f8ad64ce4d4e1815cbf Date: Wed, 30 Nov 2011 17:38:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 75196e6b-8948-4b85-8d8a-f5f34063ebf8 X-Archives-Hash: cdb9fe683c34f86c6d62a703609a9b79 commit: b41b45df8693af1b00b59f8ad64ce4d4e1815cbf Author: Pawel Hajdan, Jr gentoo org> AuthorDate: Wed Nov 30 17:37:53 2011 +0000 Commit: Pawe=C5=82 Hajdan gentoo org> CommitDate: Wed Nov 30 17:37:53 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/arch-tools.gi= t;a=3Dcommit;h=3Db41b45df Do not file bugs by default, and only stabilze latest version in ~arch. --- stabilization-candidates.py | 118 +++++++++++++++++++++++--------------= ------ 1 files changed, 63 insertions(+), 55 deletions(-) diff --git a/stabilization-candidates.py b/stabilization-candidates.py index 55c3da1..8feee30 100755 --- a/stabilization-candidates.py +++ b/stabilization-candidates.py @@ -26,6 +26,7 @@ if __name__ =3D=3D "__main__": parser.add_option("-l", "--limit", dest=3D"limit", type=3D"int", defaul= t=3D-1, help=3D"Limit of filed bugs. Default is no limit.") parser.add_option("--repo", dest=3D"repo", help=3D"Path to portage CVS = repository") parser.add_option("--category", dest=3D"category", help=3D"Portage cate= gory filter (default is all categories)") + parser.add_option("--file-bugs", dest=3D"file_bugs", action=3D"store_tr= ue", default=3DFalse, help=3D"File stabilization bugs for detected candid= ates. Otherwise (default) the candidates are just displayed.") =20 (options, args) =3D parser.parse_args() if not options.arch: @@ -92,69 +93,76 @@ if __name__ =3D=3D "__main__": candidates.append(cpv) if not candidates: continue + candidates.sort(key=3Dportage.versions.cpv_sort_key()) candidates.reverse() - best_candidate =3D None + + # Only consider the best version in ~arch for stabilization. + # It's usually better tested, and often maintainers refuse + # to stabilize anything else, e.g. bug #391607. + best_candidate =3D candidates[0] + cvs_path =3D os.path.join(options.repo, cp) - for candidate in candidates: - ebuild_name =3D portage.versions.catsplit(candidate)[1] + ".ebuild" - ebuild_path =3D os.path.join(cvs_path, ebuild_name) - manifest_path =3D os.path.join(cvs_path, 'Manifest') - original_contents =3D open(ebuild_path).read() - manifest_contents =3D open(manifest_path).read() - try: - for arch in options.arch: - subprocess.check_output(["ekeyword", arch, ebuild_name], cwd=3Dcvs_= path) - subprocess.check_output(["repoman", "manifest"], cwd=3Dcvs_path) - subprocess.check_output(["repoman", "full"], cwd=3Dcvs_path) - except subprocess.CalledProcessError: - continue - finally: - f =3D open(ebuild_path, "w") - f.write(original_contents) - f.close() - f =3D open(manifest_path, "w") - f.write(manifest_contents) - f.close() - best_candidate =3D candidate - break - if best_candidate: - # Do not risk trying to stabilize a package with known bugs. - bugs =3D bugzilla.search(cp, status=3DNone) - if bugs: - continue + ebuild_name =3D portage.versions.catsplit(best_candidate)[1] + ".ebuil= d" + ebuild_path =3D os.path.join(cvs_path, ebuild_name) + manifest_path =3D os.path.join(cvs_path, 'Manifest') + original_contents =3D open(ebuild_path).read() + manifest_contents =3D open(manifest_path).read() + try: + for arch in options.arch: + subprocess.check_output(["ekeyword", arch, ebuild_name], cwd=3Dcvs_p= ath) + subprocess.check_output(["repoman", "manifest"], cwd=3Dcvs_path) + subprocess.check_output(["repoman", "full"], cwd=3Dcvs_path) + except subprocess.CalledProcessError: + continue + finally: + f =3D open(ebuild_path, "w") + f.write(original_contents) + f.close() + f =3D open(manifest_path, "w") + f.write(manifest_contents) + f.close() =20 - # Protection against filing a stabilization bug twice. - bugs =3D bugzilla.search(best_candidate) - if bugs: - continue + # Do not risk trying to stabilize a package with known bugs. + bugs =3D bugzilla.search(cp, status=3DNone) + if bugs: + continue =20 - metadata =3D MetaDataXML(os.path.join(cvs_path, 'metadata.xml'), '/us= r/portage/metadata/herds.xml') - maintainer_split =3D metadata.format_maintainer_string().split(' ', 1= ) - maintainer =3D maintainer_split[0] - if len(maintainer_split) > 1: - other_maintainers =3D maintainer_split[1].split(',') - else: - other_maintainers =3D [] - url =3D 'http://packages.gentoo.org/package/%s?arches=3Dlinux' % urll= ib.quote(cp) - final_candidates.append((best_candidate, url, maintainer, other_maint= ainers)) + # Protection against filing a stabilization bug twice. + bugs =3D bugzilla.search(best_candidate) + if bugs: + continue + + metadata =3D MetaDataXML(os.path.join(cvs_path, 'metadata.xml'), '/usr= /portage/metadata/herds.xml') + maintainer_split =3D metadata.format_maintainer_string().split(' ', 1) + maintainer =3D maintainer_split[0] + if len(maintainer_split) > 1: + other_maintainers =3D maintainer_split[1].split(',') + else: + other_maintainers =3D [] + url =3D 'http://packages.gentoo.org/package/%s?arches=3Dlinux' % urlli= b.quote(cp) + final_candidates.append((best_candidate, url, maintainer, other_mainta= iners)) =20 if options.limit !=3D -1: final_candidates =3D random.sample(final_candidates, min(options.limit= , len(final_candidates))) for x in final_candidates: best_candidate, url, maintainer, other_maintainers =3D x - description =3D ('Is it OK to stabilize =3D%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 =3D bugzilla.post('Gentoo Linux', - 'Keywording and Stabilization', - 'Please stabilize =3D%s' % best_candidate, - description, - url=3Durl, - assigned_to=3Dmaintainer, - cc=3Dother_maintainers, - severity=3D'enhancement') - if bug_id =3D=3D 0: - print 'Submitting bug for %s failed. :-(' % best_candidate + + if options.file_bugs: + description =3D ('Is it OK to stabilize =3D%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 th= e following arches: %s' % ', '.join(options.arch)) + bug_id =3D bugzilla.post('Gentoo Linux', + 'Keywording and Stabilization', + 'Please stabilize =3D%s' % best_candidate, + description, + url=3Durl, + assigned_to=3Dmaintainer, + cc=3Dother_maintainers, + severity=3D'enhancement') + if bug_id =3D=3D 0: + print 'Submitting bug for %s failed. :-(' % best_candidate + else: + print 'Submitted bug #%d for %s. ;-)' % (bug_id, best_candidate) else: - print 'Submitted bug #%d for %s. ;-)' % (bug_id, best_candidate) + print (best_candidate, maintainer, other_maintainers)