From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 935401381F3 for ; Sun, 5 May 2013 09:38:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1F6E3E0829; Sun, 5 May 2013 09:38:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9C8B2E0829 for ; Sun, 5 May 2013 09:38:39 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8E04C33DD28 for ; Sun, 5 May 2013 09:38:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3141BE4B51 for ; Sun, 5 May 2013 09:38:37 +0000 (UTC) From: "Agostino Sarubbo" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Agostino Sarubbo" Message-ID: <1367746692.82c73ed3631aeffa3b9a0b14a6ab9693b834fd32.ago@gentoo> Subject: [gentoo-commits] dev/ago:master commit in: script/ X-VCS-Repository: dev/ago X-VCS-Files: script/batch-ekeyword-only.py script/batch-keyword.py script/batch-pretend.py script/batch-stabilize-force.py script/batch-stabilize-pretend.py script/batch-stabilize.py X-VCS-Directories: script/ X-VCS-Committer: ago X-VCS-Committer-Name: Agostino Sarubbo X-VCS-Revision: 82c73ed3631aeffa3b9a0b14a6ab9693b834fd32 X-VCS-Branch: master Date: Sun, 5 May 2013 09:38:37 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 73be58bf-9f77-404e-b8d6-b32c15eb169d X-Archives-Hash: 820751338017c1e2116e45ac5c8463f0 commit: 82c73ed3631aeffa3b9a0b14a6ab9693b834fd32 Author: Agostino Sarubbo gentoo org> AuthorDate: Sun May 5 09:38:12 2013 +0000 Commit: Agostino Sarubbo gentoo org> CommitDate: Sun May 5 09:38:12 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/ago.git;a=commit;h=82c73ed3 Add batch* script --- .../{batch-pretend.py => batch-ekeyword-only.py} | 18 +-------- script/{batch-pretend.py => batch-keyword.py} | 6 +- .../{batch-pretend.py => batch-stabilize-force.py} | 41 +++++++++++++++++++- ...batch-pretend.py => batch-stabilize-pretend.py} | 4 +- script/{batch-pretend.py => batch-stabilize.py} | 41 +++++++++++++++++++- 5 files changed, 84 insertions(+), 26 deletions(-) diff --git a/script/batch-pretend.py b/script/batch-ekeyword-only.py similarity index 85% copy from script/batch-pretend.py copy to script/batch-ekeyword-only.py index 5e45453..4506001 100755 --- a/script/batch-pretend.py +++ b/script/batch-ekeyword-only.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python # Copyright 2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 @@ -136,19 +136,3 @@ if __name__ == "__main__": if run_command(["repoman", "manifest"], cvs_path, log_file)[0] != 0: print '!!! repoman manifest failed' sys.exit(1) - for (pn, ebuild_name) in stabilization_dict[bug_id]: - cvs_path = os.path.join(options.repo, pn) - print_and_log('Working in %s...' % cvs_path, log_file) - return_code, output = run_command(["cvs", "diff"], cvs_path, log_file) - # It seems that cvs diff returns 1 if there are differences. - if return_code == 0 and not output: - print_and_log('Seems already keyworded, skipping.', log_file) - done_bugs.append(bug_id) - save_state(done_bugs) - continue - if run_command(["repoman", "full"], cvs_path, log_file)[0] != 0: - os.chdir(cvs_path) - os.system("repoman full") - sys.exit(1) - if os.path.exists('batch-stabilize.state'): - os.remove('batch-stabilize.state') diff --git a/script/batch-pretend.py b/script/batch-keyword.py similarity index 95% copy from script/batch-pretend.py copy to script/batch-keyword.py index 5e45453..1c1c126 100755 --- a/script/batch-pretend.py +++ b/script/batch-keyword.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python # Copyright 2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 @@ -125,7 +125,7 @@ if __name__ == "__main__": continue print_and_log('Working on bug %d...' % bug_id, log_file) - commit_message = "Stable for %s, wrt bug #%d" % (options.arch, bug_id) + commit_message = "Add %s, wrt bug #%d" % (options.arch, bug_id) for (pn, ebuild_name) in stabilization_dict[bug_id]: cvs_path = os.path.join(options.repo, pn) print_and_log('Working in %s...' % cvs_path, log_file) @@ -146,7 +146,7 @@ if __name__ == "__main__": done_bugs.append(bug_id) save_state(done_bugs) continue - if run_command(["repoman", "full"], cvs_path, log_file)[0] != 0: + if run_command(["repoman", "commit", "--include-arches", options.arch, "-m", commit_message], cvs_path, log_file)[0] != 0: os.chdir(cvs_path) os.system("repoman full") sys.exit(1) diff --git a/script/batch-pretend.py b/script/batch-stabilize-force.py similarity index 75% copy from script/batch-pretend.py copy to script/batch-stabilize-force.py index 5e45453..e6432b9 100755 --- a/script/batch-pretend.py +++ b/script/batch-stabilize-force.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python # Copyright 2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 @@ -146,9 +146,46 @@ if __name__ == "__main__": done_bugs.append(bug_id) save_state(done_bugs) continue - if run_command(["repoman", "full"], cvs_path, log_file)[0] != 0: + if run_command(["repoman", "commit", "--include-arches", options.arch, "-f", "-m", commit_message], cvs_path, log_file)[0] != 0: os.chdir(cvs_path) os.system("repoman full") sys.exit(1) + bug_xml = bugzilla.get(bug_id).find('bug') + has_my_arch = False + has_other_arches = False + for cc in bug_xml.findall('cc'): + body, domain = cc.text.split('@', 1) + if domain == 'gentoo.org' and body == options.arch: + has_my_arch = True + if domain == 'gentoo.org' and body in portage.archlist and body != options.arch: + has_other_arches=True + + if not has_my_arch: + print_and_log('Seems that bugzilla has already been updated.', log_file) + done_bugs.append(bug_id) + save_state(done_bugs) + continue + + print_and_log('Posting automated reply in bugzilla...', log_file) + # We don't close bugs which still have other arches for obvious reasons, + # and security bugs because stabilization is not the last step for them. + if has_other_arches or 'Security' in bug_xml.find('product').text: + bugzilla.modify( + bug_id, + comment='%s stable' % options.arch, + remove_cc='%s@gentoo.org' % options.arch) + print_and_log('Successfully updated bug %d.' % bug_id, log_file) + else: + bugzilla.modify( + bug_id, + comment='%s stable. Last arch, closing' % options.arch, + remove_cc='%s@gentoo.org' % options.arch, + status='RESOLVED', + resolution='FIXED') + print_and_log('Succesfully updated bug %d and closed it.' % bug_id, log_file) + + done_bugs.append(bug_id) + save_state(done_bugs) + if os.path.exists('batch-stabilize.state'): os.remove('batch-stabilize.state') diff --git a/script/batch-pretend.py b/script/batch-stabilize-pretend.py similarity index 97% copy from script/batch-pretend.py copy to script/batch-stabilize-pretend.py index 5e45453..daafc5a 100755 --- a/script/batch-pretend.py +++ b/script/batch-stabilize-pretend.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python # Copyright 2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 @@ -146,7 +146,7 @@ if __name__ == "__main__": done_bugs.append(bug_id) save_state(done_bugs) continue - if run_command(["repoman", "full"], cvs_path, log_file)[0] != 0: + if run_command(["repoman", "full", "--include-arches", options.arch], cvs_path, log_file)[0] != 0: os.chdir(cvs_path) os.system("repoman full") sys.exit(1) diff --git a/script/batch-pretend.py b/script/batch-stabilize.py similarity index 75% rename from script/batch-pretend.py rename to script/batch-stabilize.py index 5e45453..9bdfe8d 100755 --- a/script/batch-pretend.py +++ b/script/batch-stabilize.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python # Copyright 2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 @@ -146,9 +146,46 @@ if __name__ == "__main__": done_bugs.append(bug_id) save_state(done_bugs) continue - if run_command(["repoman", "full"], cvs_path, log_file)[0] != 0: + if run_command(["repoman", "commit", "--include-arches", options.arch, "-m", commit_message], cvs_path, log_file)[0] != 0: os.chdir(cvs_path) os.system("repoman full") sys.exit(1) + bug_xml = bugzilla.get(bug_id).find('bug') + has_my_arch = False + has_other_arches = False + for cc in bug_xml.findall('cc'): + body, domain = cc.text.split('@', 1) + if domain == 'gentoo.org' and body == options.arch: + has_my_arch = True + if domain == 'gentoo.org' and body in portage.archlist and body != options.arch: + has_other_arches=True + + if not has_my_arch: + print_and_log('Seems that bugzilla has already been updated.', log_file) + done_bugs.append(bug_id) + save_state(done_bugs) + continue + + print_and_log('Posting automated reply in bugzilla...', log_file) + # We don't close bugs which still have other arches for obvious reasons, + # and security bugs because stabilization is not the last step for them. + if has_other_arches or 'Security' in bug_xml.find('product').text: + bugzilla.modify( + bug_id, + comment='%s stable' % options.arch, + remove_cc='%s@gentoo.org' % options.arch) + print_and_log('Successfully updated bug %d.' % bug_id, log_file) + else: + bugzilla.modify( + bug_id, + comment='%s stable. Last arch, closing' % options.arch, + remove_cc='%s@gentoo.org' % options.arch, + status='RESOLVED', + resolution='FIXED') + print_and_log('Succesfully updated bug %d and closed it.' % bug_id, log_file) + + done_bugs.append(bug_id) + save_state(done_bugs) + if os.path.exists('batch-stabilize.state'): os.remove('batch-stabilize.state')