From 9b8ef056ffe123fdd90e5c156f8c6ce532376db9 Mon Sep 17 00:00:00 2001 From: "Pawel Hajdan, Jr" Date: Fri, 21 Oct 2011 17:14:28 +0200 Subject: Fix bugs: - open log in append mode to avoid losing logs on retry - delete old ChangeLogs to avoid adding the same entry multiple times - re-Manifest after ekeyword to avoid manifest error on dependent packages --- batch-stabilize.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/batch-stabilize.py b/batch-stabilize.py index b76bac7..0289c42 100755 --- a/batch-stabilize.py +++ b/batch-stabilize.py @@ -100,19 +100,29 @@ if __name__ == "__main__": print 'Sanity check failed. Please make sure your CVS repo is up to date (cvs up).' sys.exit(1) - with open('batch-stabilize.log', 'w') as log_file: + with open('batch-stabilize.log', 'a') as log_file: for bug_id in stabilization_dict: 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]: cvs_path = os.path.join(options.repo, pn) print_and_log('Working in %s...' % cvs_path, log_file) + + # Remove existing changelog to avoid adding duplicate entries. + try: + os.remove(os.path.join(cvs_path, 'ChangeLog')) + except OSError: + pass + if run_command(["cvs", "up"], cvs_path, log_file)[0] != 0: print '!!! cvs up failed' sys.exit(1) if run_command(["ekeyword", options.arch, ebuild_name], cvs_path, log_file)[0] != 0: print '!!! ekeyword failed' sys.exit(1) + 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) -- cgit v1.2.3-65-gdbad