[Reproducible-commits] [misc] 01/01: clean-notes: add -s to just sort the notes, without doing cleanup

Mattia Rizzolo mattia at mapreri.org
Fri May 29 09:01:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

mapreri-guest pushed a commit to branch master
in repository misc.

commit 762738837db8e8b2ebdad5b7723f9fda5990ed8e
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Fri May 29 11:01:05 2015 +0200

    clean-notes: add -s to just sort the notes, without doing cleanup
---
 clean-notes | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/clean-notes b/clean-notes
index 3a3de7e..820420c 100755
--- a/clean-notes
+++ b/clean-notes
@@ -45,6 +45,8 @@ parser.add_argument('-d', '--disable', action='append', default=[],
                     help="disable a particular view (choose from above)")
 parser.add_argument("--ignore-duplicates", action="store_true",
                     help="ATTENTION! This option remove any duplicated field present in the file!")
+parser.add_argument('-s', '--sort-only', action='store_true',
+                    help='Only sort the notes, do no clean up')
 parser.add_argument("-v", "--verbose", action="store_true")
 parser.add_argument("-n", "--dry-run", action="store_true")
 
@@ -183,7 +185,7 @@ def load_notes():
 def check_notes_validity(notes, testedpkgs):
     failed = False
     badpkgs = []
-    for pkg in notes:
+    for pkg in sorted(notes):
         if pkg not in testedpkgs:
             badpkgs.append(pkg)
             failed = True
@@ -378,10 +380,13 @@ if __name__ == '__main__':
     if 'not-usertagged' not in args.disable or \
        'missing-usertagged' not in args.disable:
         conn = start_udd_connection()
-    testedpkgs = load_reproducible_status()
     notes = load_notes()
-    check_notes_validity(notes, testedpkgs)
-    toremove = find_old_notes(testedpkgs, notes)
+    if not args.sort_only:
+        testedpkgs = load_reproducible_status()
+        check_notes_validity(notes, testedpkgs)
+        toremove = find_old_notes(testedpkgs, notes)
+    else:
+        toremove = []
     notes = cleanup_notes(notes, toremove)
     if 'not-usertagged' not in args.disable:
         check_bugs(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