[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.44-598-gace668e

Holger Levsen holger at layer-acht.org
Sun May 27 13:47:48 UTC 2012


The following commit has been merged in the piatti branch:
commit 8447fa7d1fb29dd912a1ab13dc0793996e7da065
Author: David Steele <dsteele at gmail.com>
Date:   Thu May 24 21:41:54 2012 -0400

    Sort the failed-testing and cannot-be-tested summaries by block count
      Reverse dependency count and blocked package count are already
      being displated on that page. No other pages are affected.

diff --git a/debian/changelog b/debian/changelog
index c4da423..df50dba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,14 +5,15 @@ piuparts (0.45) UNRELEASED; urgency=low
     now.  
 
   [ David Steele ]
+  * packagesdb.py:
+    - Calculate recursive reverse dependency count, and store in PackagesDB.
+    - Calculate the count of packages being blocked by a failed package.
   * piuparts-report.py:
     - Release Section object when section processing is complete. 
       (Closes: #673919)
-  * packagesdb.py
-    - Calculate recursive reverse dependency count, and store in PackagesDB.
-    - Calculate the count of packages being blocked by a failed package.
-  * piuparts-report
-    - Display reverse dependency counts and block counts to failure summaries
+    - Display reverse dependency counts and block counts to failure summaries.
+    - Sort the failed-testing and cannot-be-tested summaries by block count.
+      (Closes: #674498)
 
   [ Andreas Beckmann ]
   * piuparts.py:
diff --git a/piuparts-report.py b/piuparts-report.py
index 5c772a2..edb3194 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -1004,8 +1004,20 @@ class Section:
         for state in self._binary_db.get_active_states():
             logging.debug("Writing page for %s" % state)
             vlist = ""
-            for name in sorted(self._binary_db.get_pkg_names_in_state(state)):
-                package = self._binary_db.get_package(name)
+
+            def cmp_func(a, b):
+                """Sort by block count first"""
+                rrdep_cmp = cmp( a.block_count(), b.block_count())
+                if rrdep_cmp != 0:
+                    return -rrdep_cmp
+                else:
+                    return cmp( a["Package"], b["Package"] )
+
+            names = self._binary_db.get_pkg_names_in_state(state)
+            packages = [self._binary_db.get_package(name) for name in names]
+            packages.sort( cmp_func )
+
+            for package in packages:
                 if state not in ['failed-testing', 'cannot-be-tested' ]:
                     vlist += "<li id=\"%s\">%s (%s)" % (
                                          package["Package"],

-- 
piuparts git repository



More information about the Piuparts-commits mailing list