[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.44-638-g256a900

Andreas Beckmann debian at abeckmann.de
Fri Jun 1 21:08:33 UTC 2012


The following commit has been merged in the develop branch:
commit c2b8174e11c5c92a045517ac98567d24299afc97
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Fri Jun 1 22:09:46 2012 +0200

    add support for logs in an /affected/ subdirectory
    
    create the /affected/ directory in addition to pass, fail, bugged, untestable
    handle logs found in /affected/ similar to /bugged/
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 648913c..b7bb43f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -70,6 +70,7 @@ piuparts (0.45) UNRELEASED; urgency=low
   * piuparts-report.py:
     - Exclude obsolete states from generated report.
     - Establish packagesdb working directory in Section.
+    - Handle logs in /affected/ directories.
   * piuparts-analyze.py:
     - Don't report further bugs/versions if we found a match.
   * Remove known_circular_depends from piuparts.conf handling.
diff --git a/piuparts-report.py b/piuparts-report.py
index 975703a..faf669c 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -339,6 +339,7 @@ title_by_dir = {
     "pass": "PASSED piuparts logs",
     "fail": "Failed UNREPORTED piuparts logs",
     "bugged": "Failed REPORTED piuparts logs",
+    "affected": "Failed AFFECTED piuparts logs",
     "reserved": "RESERVED packages",
     "untestable": "UNTESTABLE packages",
 }
@@ -350,6 +351,8 @@ desc_by_dir = {
             "Bugs have not yet been reported.",
     "bugged": "Log files for packages that have FAILED testing. " +
               "Bugs have been reported, but not yet fixed.",
+    "affected": "Log files for packages that have dependencies FAILED testing. " +
+              "Bugs have been reported, but not yet fixed.",
     "reserved": "Packages that are RESERVED for testing on a node in a " +
                 "distributed piuparts network.",
     "untestable": "Log files for packages that have are UNTESTABLE with " +
@@ -360,6 +363,7 @@ state_by_dir = {
     "pass": "successfully-tested",
     "fail": "failed-testing",
     "bugged": "failed-testing",
+    "affected": "failed-testing",
     "reserved": "waiting-to-be-tested",
     "untestable": "cannot-be-tested",
 }
@@ -732,7 +736,7 @@ class Section:
         if state == "successfully-tested":
           dirs = ["pass"]
         elif state == "failed-testing":
-          dirs = ["fail", "bugged"]
+          dirs = ["fail", "bugged", "affected"]
         elif state == "cannot-be-tested":
           dirs = ["untestable"]
 
@@ -740,7 +744,7 @@ class Section:
           links = self.find_links_to_logs (package_name, dirs, logs_by_dir)
           link = ", ".join(links)
 
-        if "/bugged/" in link:
+        if "/bugged/" in link or "/affected/" in link:
           link += " - <a href=\"http://bugs.debian.org/cgi-bin/pkgreport.cgi?package="+package_name+"\" target=\"_blank\" class=\"bugged\"> bug filed </a>"
 
         return link
@@ -960,15 +964,17 @@ class Section:
               f.close()
               if state == "failed-testing":
                 count_bugged = string.count(rows,"/bugged/")
+                count_affected = string.count(rows,"/affected/")
                 count_failed = string.count(rows,"/fail/") 
-                if count_bugged > 0 or count_failed > 0:
-                  substats = ": "
+                sep = ": "
                 if count_bugged > 0:
-                  substats += "%s bugged" % count_bugged
-                if count_bugged > 0 and count_failed > 0:
-                  substats += ", "
+                  substats += sep + "%s bugged" % count_bugged
+                  sep = ", "
+                if count_affected > 0:
+                  substats += sep + "%s affected" % count_affected
+                  sep = ", "
                 if count_failed > 0:
-                  substats += "<span id=\"needs-bugging\">%s failed</span>" % count_failed
+                  substats += sep + "<span id=\"needs-bugging\">%s failed</span>" % count_failed
               else:
                   count_passed = string.count(rows,"/pass/")
                   if count_passed > 0:
@@ -992,7 +998,7 @@ class Section:
             dir_link = ""
             analysis = ""
             for vdir in dirs:
-              if vdir in ("pass", "fail", "bugged", "untestable") and state_by_dir[vdir] == state:
+              if vdir in ("pass", "fail", "bugged", "affected", "untestable") and state_by_dir[vdir] == state:
                 dir_link += "<a href='%s.html'>%s</a> logs<br>" % (vdir, html_protect(vdir))
             if state in ("successfully-tested", "failed-testing"):
               analysis = self.create_and_link_to_analysises(state)
@@ -1109,7 +1115,7 @@ class Section:
 
     def generate_html(self):
         logging.debug("Finding log files")
-        dirs = ["pass", "fail", "bugged", "reserved", "untestable"]
+        dirs = ["pass", "fail", "bugged", "affected", "reserved", "untestable"]
         logs_by_dir = {}
         for vdir in dirs:
             logs_by_dir[vdir] = find_files_with_suffix(vdir, ".log")
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 5b293be..ecbc6ae 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -274,7 +274,7 @@ class PackagesDB:
         self._in_state = None
         self._package_state = {}
         self.set_subdirs(ok="pass", fail="fail", evil="untestable",
-                         reserved="reserved", morefail=["bugged"])
+                         reserved="reserved", morefail=["bugged", "affected"])
 
     def set_subdirs(self, ok=None, fail=None, evil=None, reserved=None, morefail=None):
         # Prefix all the subdirs with the prefix
diff --git a/unittests.py b/unittests.py
index a6eb344..a499880 100644
--- a/unittests.py
+++ b/unittests.py
@@ -54,6 +54,7 @@ class FakeLogDB(piupartslib.packagesdb.LogDB):
             "untestable": [],
             "reserved": [],
             "bugged": [],
+            "affected": [],
         }
 
     def listdir(self, dirname):

-- 
piuparts git repository



More information about the Piuparts-commits mailing list