[Reproducible-commits] [misc] 01/01: edit-notes: --fix-deterministic

Chris West faux-guest at moszumanska.debian.org
Sun May 3 09:21: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 f1f1ec4e22e8aa80d639ae19b6877db33d6d9ac6
Author: Chris West (Faux) <git at goeswhere.com>
Date:   Sun May 3 10:21:14 2015 +0100

    edit-notes: --fix-deterministic
---
 edit-notes | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/edit-notes b/edit-notes
index 02ff413..48c885d 100755
--- a/edit-notes
+++ b/edit-notes
@@ -9,19 +9,24 @@ parser = argparse.ArgumentParser()
 parser.add_argument('-f', '--fix-note', action='append', default=[])
 parser.add_argument('-a', '--add-note', action='append', default=[])
 parser.add_argument('-v', '--take-version', action='store_true')
+parser.add_argument('-d', '--fix-deterministic', action='store_true')
 parser.add_argument('packages', nargs='*')
 args = parser.parse_args()
 
 with open('issues.yml') as fd:
-    issues = yaml.safe_load(fd).keys()
+    issues = yaml.safe_load(fd)
 
 if __name__ == '__main__':
+    to_fix = set(args.fix_note)
     testedpkgs = clean.load_reproducible_status()
     notes = clean.load_notes()
     for add in args.add_note:
-        if not add in issues:
+        if not add in issues.keys():
             raise ValueError('%r is not a valid issue' % add)
 
+    if args.fix_deterministic:
+        to_fix.update((k for (k,v) in issues.items() if v.get('deterministic', False)))
+
     for package in args.packages or notes.keys():
         try:
             data = notes[package]
@@ -35,11 +40,11 @@ if __name__ == '__main__':
         if args.take_version:
             data['version'] = testedpkgs[package]['version']
 
-        for fix in args.fix_note:
+        for fix in to_fix:
             if testedpkgs.get(package, {}).get('status', False) == 'reproducible':
-                issues = data.get('issues', [])
-                if fix in issues:
-                    issues.remove(fix)
+                package_issues = data.get('issues', [])
+                if fix in package_issues:
+                    package_issues.remove(fix)
 
         for add in args.add_note:
             if not 'issues' in data:

-- 
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