From: "Paweł Hajdan" <phajdan.jr@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/arch-tools:master commit in: /
Date: Fri, 9 Mar 2012 11:49:53 +0000 (UTC) [thread overview]
Message-ID: <1331293750.4a2ba0432b825af79fd4348689d3ae9033450b88.phajdan.jr@gentoo> (raw)
commit: 4a2ba0432b825af79fd4348689d3ae9033450b88
Author: Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 9 11:49:10 2012 +0000
Commit: Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org>
CommitDate: Fri Mar 9 11:49:10 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/arch-tools.git;a=commit;h=4a2ba043
Avoid duplicating work: remember which bugs have been done.
---
batch-stabilize.py | 27 +++++++++++++++++++++++++--
1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/batch-stabilize.py b/batch-stabilize.py
index db869bb..877e5dc 100755
--- a/batch-stabilize.py
+++ b/batch-stabilize.py
@@ -6,6 +6,7 @@ import glob
import itertools
import optparse
import os
+import pickle
import re
import shutil
import subprocess
@@ -37,6 +38,10 @@ def run_command(args, cwd, log):
finally:
log.flush()
+def save_state(done_bugs):
+ with open('batch-stabilize.state', 'w') as state_file:
+ pickle.dump(done_bugs, state_file)
+
class MyBugz(bugz.bugzilla.Bugz):
def get_input(self, prompt):
return raw_input(prompt)
@@ -58,6 +63,11 @@ if __name__ == "__main__":
if args:
parser.error("unrecognized command-line args")
+ done_bugs = []
+ if os.path.exists('batch-stabilize.state'):
+ with open('batch-stabilize.state', 'r') as state_file:
+ done_bugs = pickle.load(state_file)
+
url = 'https://bugs.gentoo.org'
print 'You may be prompted for your Gentoo Bugzilla username and password (%s).' % url
bugzilla = MyBugz(url)
@@ -110,6 +120,10 @@ if __name__ == "__main__":
with open('batch-stabilize.log', 'a') as log_file:
for bug_id in stabilization_dict:
+ if bug_id in done_bugs:
+ print_and_log('Skipping bug #%d because it is marked as done.' % bug_id, log_file)
+ continue
+
print_and_log('Working on bug %d...' % bug_id, log_file)
commit_message = "%s stable wrt bug #%d" % (options.arch, bug_id)
for (pn, ebuild_name) in stabilization_dict[bug_id]:
@@ -140,10 +154,11 @@ if __name__ == "__main__":
# 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(["echangelog", commit_message], cvs_path, log_file)[0] != 0:
- print '!!! echangelog failed'
- sys.exit(1)
+ print_and_log('echangelog failed, maybe just the Manifest is being updated; continuing', log_file)
if run_command(["repoman", "manifest"], cvs_path, log_file)[0] != 0:
print '!!! repoman manifest failed'
sys.exit(1)
@@ -162,6 +177,8 @@ if __name__ == "__main__":
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)
@@ -181,3 +198,9 @@ if __name__ == "__main__":
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')
next reply other threads:[~2012-03-09 11:50 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 11:49 Paweł Hajdan [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-07-10 20:29 [gentoo-commits] proj/arch-tools:master commit in: / Paweł Hajdan
2017-07-09 14:42 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2015-01-05 14:41 Paweł Hajdan
2014-06-14 9:47 Paweł Hajdan
2014-04-07 12:40 Samuli Suominen
2014-02-12 7:06 Paweł Hajdan
2013-06-22 15:05 Paweł Hajdan
2013-06-22 14:57 Paweł Hajdan
2013-05-19 23:35 Paweł Hajdan
2013-03-11 21:56 Paweł Hajdan
2013-02-28 4:50 Paweł Hajdan
2013-02-28 4:50 Paweł Hajdan
2012-10-16 16:54 Paweł Hajdan
2012-10-16 16:54 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:03 Paweł Hajdan
2012-10-08 16:02 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-08-01 11:08 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-08-01 7:28 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-06-04 9:18 [gentoo-commits] proj/arch-tools:new-pybugz " Paweł Hajdan
2012-10-08 16:03 ` [gentoo-commits] proj/arch-tools:master " Paweł Hajdan
2012-03-27 15:26 Paweł Hajdan
2012-03-09 11:49 Paweł Hajdan
2012-02-02 16:48 Paweł Hajdan
2012-01-27 14:55 Paweł Hajdan
2012-01-21 17:05 Paweł Hajdan
2011-12-14 7:23 Paweł Hajdan
2011-12-06 11:14 Paweł Hajdan
2011-12-01 18:56 Paweł Hajdan
2011-12-01 18:47 Paweł Hajdan
2011-12-01 18:47 Paweł Hajdan
2011-11-30 17:38 Paweł Hajdan
2011-11-23 8:59 Paweł Hajdan
2011-11-23 8:59 Paweł Hajdan
2011-11-21 8:34 Paweł Hajdan
2011-11-03 11:00 Paweł Hajdan
2011-10-22 8:18 Paweł Hajdan
2011-10-21 15:15 Paweł Hajdan
2011-10-18 14:05 Paweł Hajdan
2011-10-16 3:51 Paweł Hajdan
2011-10-13 21:59 Paweł Hajdan
2011-10-04 21:46 Paweł Hajdan
2011-09-19 3:09 Paweł Hajdan
2011-08-07 3:26 Paweł Hajdan
2011-06-05 16:16 Paweł Hajdan
2011-06-02 15:41 Paweł Hajdan
2011-06-02 15:38 Paweł Hajdan
2011-05-25 19:51 Paweł Hajdan
2011-05-25 10:32 Paweł Hajdan
2011-05-22 15:31 Paweł Hajdan
2011-05-22 15:16 Paweł Hajdan
2011-05-22 13:36 Paweł Hajdan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331293750.4a2ba0432b825af79fd4348689d3ae9033450b88.phajdan.jr@gentoo \
--to=phajdan.jr@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox