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 1RBCoe-0008Lu-1H for garchives@archives.gentoo.org; Tue, 04 Oct 2011 21:46:20 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4312EE06C8; Tue, 4 Oct 2011 21:46:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 10F07E06C8 for ; Tue, 4 Oct 2011 21:46:11 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 719B41B402B for ; Tue, 4 Oct 2011 21:46:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C4B3180042 for ; Tue, 4 Oct 2011 21:46:10 +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: batch-stabilize.py X-VCS-Directories: / X-VCS-Committer: phajdan.jr X-VCS-Committer-Name: Paweł Hajdan X-VCS-Revision: a6ed12cee737b66c730f8a93769f242154ee3ec1 Date: Tue, 4 Oct 2011 21:46:10 +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: X-Archives-Hash: e1b788e56fd9471db80ce2aa17dcb62d commit: a6ed12cee737b66c730f8a93769f242154ee3ec1 Author: Pawel Hajdan, Jr gentoo org> AuthorDate: Tue Oct 4 21:45:38 2011 +0000 Commit: Pawe=C5=82 Hajdan gentoo org> CommitDate: Tue Oct 4 21:45:38 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/arch-tools.gi= t;a=3Dcommit;h=3Da6ed12ce Update Bugzilla when stabilizing packages. --- batch-stabilize.py | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+), 0 deletions(-) diff --git a/batch-stabilize.py b/batch-stabilize.py index 8414f44..912d26b 100755 --- a/batch-stabilize.py +++ b/batch-stabilize.py @@ -9,6 +9,7 @@ import re import subprocess import sys =20 +import bugz.bugzilla import portage.versions =20 BUG_REGEX =3D re.compile("[Bb]ug #?(\d+)") @@ -31,6 +32,10 @@ def run_command(args, cwd, log): finally: log.flush() =20 +class MyBugz(bugz.bugzilla.Bugz): + def get_input(self, prompt): + return raw_input(prompt) + if __name__ =3D=3D "__main__": parser =3D optparse.OptionParser() parser.add_option("--arch", dest=3D"arch", help=3D"Gentoo arch to use, = e.g. x86, amd64, ...") @@ -47,6 +52,11 @@ if __name__ =3D=3D "__main__": parser.error("--repo option is required") if args: parser.error("unrecognized command-line args") + + url =3D 'https://bugs.gentoo.org' + print 'You may be prompted for your Gentoo Bugzilla username and passwo= rd (%s).' % url + bugzilla =3D MyBugz(url) + bugzilla.auth() =09 with open(options.input_filename, "r") as input_file: stabilization_list =3D [] @@ -115,3 +125,26 @@ if __name__ =3D=3D "__main__": if run_command(["repoman", "commit", "-m", commit_message], cvs_path= , log_file)[0] !=3D 0: print '!!! repoman full failed' sys.exit(1) + log_file.write('Posting automated reply in bugzilla...\n') + bug_xml =3D bugzilla.get(bug_id).find('bug') + has_other_arches =3D False + for cc in bug_xml.findall('cc'): + body, domain =3D cc.text.split('@', 1) + if domain =3D=3D 'gentoo.org' and body in portage.archlist and body= !=3D options.arch: + has_other_arches=3DTrue + # We don't close bugs which still have other arches for obvious reas= ons, + # and security bugs because stabilization is not the last step for t= hem. + if has_other_arches or 'Security' in bug_xml.find('product').text: + bugzilla.modify( + bug_id, + comment=3D'%s stable' % options.arch, + remove_cc=3D'%s@gentoo.org' % options.arch) + log_file.write('Successfully updated bug %d.\n' % bug_id) + else: + bugzilla.modify( + bug_id, + comment=3D'%s stable, closing' % options.arch, + remove_cc=3D'%s@gentoo.org' % options.arch, + status=3D'RESOLVED', + resolution=3D'FIXED') + log_file.write('Succesfully updated bug %d and closed it.\n' % bug_= id)