[Reproducible-commits] [misc] 04/04: clean-notes: teach load_reproducible_status() to prefer unstable packages, then testing, then exp

Mattia Rizzolo mattia at mapreri.org
Wed Jun 24 14:35:36 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 2e2e20022745be24b889f2e89da60c9062ef16f9
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Wed Jun 24 14:34:04 2015 +0000

    clean-notes: teach load_reproducible_status() to prefer unstable packages, then testing, then exp
---
 clean-notes | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/clean-notes b/clean-notes
index 08da45b..fc0c087 100755
--- a/clean-notes
+++ b/clean-notes
@@ -175,23 +175,27 @@ def load_reproducible_status():
     status = {}
     try:
         with open('reproducible.json') as fd:
-            r = json.load(fd)
+            rstatus = json.load(fd)
     except FileNotFoundError:
-        r = requests.get(reproducible_json)
-        r = r.json()
-    for item in r:
+        rstatus = requests.get(reproducible_json)
+        rstatus = r.json()
+    for item in rstatus:
         pkg = item['package']
         version = str(item['version'])
+        # feed status with the unstable value, if available, otherwise prefer
+        # testing and then experimental
         try:
-            if version_compare(str(status[pkg]['version']), version) < 0:
+            if status[pkg]['suite'] == 'unstable':
+                continue  # that's the best
+            elif status[pkg]['suite'] == 'experimental':  # whatever we've now
+                status[pkg]['version'] = version          # is better
+                status[pkg]['suite'] = item['suite']
+                status[pkg]['status'] = item['status']
+            elif status[pkg]['suite'] == 'testing' and \
+                    item['suite'] != 'experimental':
                 status[pkg]['version'] = version
                 status[pkg]['suite'] = item['suite']
                 status[pkg]['status'] = item['status']
-            elif version_compare(str(status[pkg]['version']), version) == 0:
-                if item['suite'] == 'unstable':
-                    status[pkg]['version'] = version
-                    status[pkg]['suite'] = item['suite']
-                    status[pkg]['status'] = item['status']
         except KeyError:
             status[pkg] = {}
             status[pkg]['version'] = version

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