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

Andreas Beckmann debian at abeckmann.de
Sun May 27 13:47:37 UTC 2012


The following commit has been merged in the piatti branch:
commit e144d0177ae621c37049c8e41da38815ed534dfc
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Thu Mar 22 08:58:19 2012 +0100

    exclude obsolete states from report
    
    we can't remove them completely as that would break the historical
    data that is used to generate the plots
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 3a124fa..12ce08c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,8 @@ piuparts (0.45) UNRELEASED; urgency=low
     - Stop using static known_circular_depends.
     - Compute dependency cycles and test packages on such cycles if all
       non-circular dependencies are satisfied.
+  * piuparts-report.py:
+    - Exclude obsolete states from generated report.
   * Remove known_circular_depends from piuparts.conf handling.
   * Remove static list known_circular_depends from piuparts.conf.
 
diff --git a/piuparts-report.py b/piuparts-report.py
index 0c1234d..7bac7c2 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -458,10 +458,10 @@ def emphasize_reason(reason):
         "dependency-failed-testing",
         "dependency-cannot-be-tested",
         "dependency-does-not-exist",
-        "circular-dependency",
+        "circular-dependency",  # obsolete
         "unknown",
-        "unknown-preferred-alternative",
-        "no-dependency-from-alternatives-exists",
+        "unknown-preferred-alternative",  # obsolete
+        "no-dependency-from-alternatives-exists",  # obsolete
         "does-not-exist",
     ]
     if reason in bad_states:
@@ -804,7 +804,7 @@ class Section:
             # The latter is a FIXME which needs parsing the Packages files from other archs too
             continue
           current_version = self._source_db.get_control_header(source, "Version")
-          if state != "circular-dependency" and not "waiting" in state and "dependency" in state:
+          if not "waiting" in state and "dependency" in state:
             state_style="lightalertlabelcell"
           elif state == "failed-testing":
             state_style="lightlabelcell"
@@ -947,7 +947,7 @@ class Section:
 
     def write_section_index_page(self,dirs,total_packages):
         tablerows = ""
-        for state in self._binary_db.get_states():
+        for state in self._binary_db.get_active_states():
             dir_link = ""
             analysis = ""
             for vdir in dirs:
@@ -989,7 +989,7 @@ class Section:
         return vlist
 
     def write_state_pages(self):
-        for state in self._binary_db.get_states():
+        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)):
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index cebade5..d4baa67 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -225,6 +225,12 @@ class PackagesDB:
         "essential-required",
     ]
 
+    _obsolete_states = [
+        "circular-dependency",
+        "unknown-preferred-alternative",
+        "no-dependency-from-alternatives-exists",
+    ]
+
     _propagate_error_state = {
         "failed-testing": "dependency-failed-testing",
         "cannot-be-tested": "dependency-cannot-be-tested",
@@ -468,6 +474,9 @@ class PackagesDB:
     def get_states(self):
         return self._states
 
+    def get_active_states(self):
+        return [x for x in self._states if not x in self._obsolete_states]
+
     def get_pkg_names_in_state(self, state):
         self._compute_package_states()
         return set(self._in_state[state])

-- 
piuparts git repository



More information about the Piuparts-commits mailing list