[Reproducible-commits] [misc] 01/01: edit-notes can add notes
Chris West
faux-guest at moszumanska.debian.org
Sun Feb 22 15:20:26 UTC 2015
This is an automated email from the git hooks/post-receive script.
faux-guest pushed a commit to branch master
in repository misc.
commit 060aeb52103d934aea57222ac686ec06b8cdebef
Author: Chris West (Faux) <git at goeswhere.com>
Date: Sun Feb 22 15:20:22 2015 +0000
edit-notes can add notes
---
edit-notes | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/edit-notes b/edit-notes
index 05c6a51..4f12277 100755
--- a/edit-notes
+++ b/edit-notes
@@ -1,21 +1,44 @@
#!/usr/bin/env python3
import argparse
+import yaml
clean = __import__('clean-notes')
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--fix-note', action='append', default=[])
+parser.add_argument('-a', '--add-note', action='append', default=[])
+parser.add_argument('packages', nargs='*')
args = parser.parse_args()
+with open('issues.yml') as fd:
+ issues = yaml.safe_load(fd).keys()
+
if __name__ == '__main__':
testedpkgs = clean.load_reproducible_status()
notes = clean.load_notes()
- for fix in args.fix_note:
- for package,data in notes.items():
+ for add in args.add_note:
+ if not add in issues:
+ raise Exception(add + ' is not a valid issue')
+
+ for package in args.packages or notes.keys():
+ try:
+ data = notes[package]
+ except KeyError:
+ status = testedpkgs[package]
+ data = notes[package] = { 'version': status['version'] }
+
+ for fix in args.fix_note:
if testedpkgs.get(package, {}).get('status', False) == 'reproducible':
issues = data.get('issues', [])
if fix in issues:
issues.remove(fix)
+
+ for add in args.add_note:
+ if not 'issues' in data:
+ data['issues'] = []
+ if not add in data['issues']:
+ data['issues'].append(add)
+
clean.write_out(notes)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git
More information about the Reproducible-commits
mailing list