[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 9bcbfe0fa48aba1da806fecfea79e3aa2d7bdb27
Andreas Beckmann
debian at abeckmann.de
Fri Dec 2 13:30:28 UTC 2011
The following commit has been merged in the develop branch:
commit 4e292ce5c42368cdbaf5de05e4e6c4e5a187b5aa
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Tue Nov 29 18:05:16 2011 +0100
report stale logfiles from removed binary packages
report logfiles that have no corresponding binary package
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/piuparts-report.py b/piuparts-report.py
index 9b99c47..17ccca6 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -1019,6 +1019,17 @@ class Section:
"list": vlist
}))
+
+ def detect_removed_packages(self, logs_by_dir):
+ for vdir in logs_by_dir.keys():
+ for log in sorted(logs_by_dir[vdir]):
+ if log.endswith(".log"):
+ package, version = log[:-len(".log")].split("_")
+ if not self._binary_db.has_package(package):
+ logging.debug("Obsolete log file: %s/%s" % (vdir, log))
+ logs_by_dir[vdir].remove(log)
+
+
def generate_html(self):
logging.debug("Finding log files")
dirs = ["pass", "fail", "bugged", "reserved", "untestable"]
@@ -1026,6 +1037,9 @@ class Section:
for vdir in dirs:
logs_by_dir[vdir] = find_files_with_suffix(vdir, ".log")
+ logging.debug("Detecting removed packages")
+ self.detect_removed_packages(logs_by_dir)
+
logging.debug("Copying log files")
copy_logs(logs_by_dir, self._output_directory)
@@ -1066,6 +1080,7 @@ class Section:
self.generate_html()
os.chdir(oldcwd)
+
def main():
setup_logging(logging.DEBUG, None)
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 54bb6d6..11a908f 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -466,6 +466,7 @@ class PackagesDB:
return set(self._in_state[state])
def has_package(self, name):
+ self._find_all_packages()
return name in self._packages
def get_package(self, name):
--
piuparts git repository
More information about the Piuparts-commits
mailing list