[Piuparts-commits] rev 346 - trunk

Holger Levsen holger at alioth.debian.org
Fri Apr 17 19:49:54 UTC 2009


Author: holger
Date: 2009-04-17 19:49:53 +0000 (Fri, 17 Apr 2009)
New Revision: 346

Modified:
   trunk/TODO
   trunk/piuparts-report.py
Log:
dont write counts.txt if it has already been written that day

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2009-04-17 19:35:52 UTC (rev 345)
+++ trunk/TODO	2009-04-17 19:49:53 UTC (rev 346)
@@ -8,7 +8,6 @@
 --- refactor code, sources.txt should not be calculated where it currently is
 --- include links to http://qa.debian.org/developer.php?login=$maintainer_email
 --- include links to logfiles in source summary pages
---- dont write counts.txt if it has already been written that day
 -- slave
 --- mention distro when sending logs
 --- slave_run: cleanup stale proc mountpoints
@@ -19,6 +18,9 @@
 - take care of old conf files on upgrades
 - take care of old pyc files from python-central
 - test pipuparts with piuparts before uploading
+- provides are not handled correctky: ie libapt-pkg-perl has a dependency on 
+  libapt-pkg-libc6.7-6-4.6 which piuparts believes is an unknown-package while 
+  in reality its provided by apt
 
 for 0.37 and on
 

Modified: trunk/piuparts-report.py
===================================================================
--- trunk/piuparts-report.py	2009-04-17 19:35:52 UTC (rev 345)
+++ trunk/piuparts-report.py	2009-04-17 19:49:53 UTC (rev 346)
@@ -489,6 +489,12 @@
     f.write(contents)
     f.close()
 
+def read_file(filename):
+    f = file(filename, "r")
+    l = f.readlines()
+    f.close()
+    return l
+
 def create_section_navigation(section_names):
     tablerows = ""
     for section in section_names:
@@ -674,7 +680,8 @@
     def write_counts_summary(self):
         logging.debug("Writing counts.txt")    
         header = "date"
-        counts = "%s" % time.strftime("%Y%m%d")
+        current_day = "%s" % time.strftime("%Y%m%d")
+        counts = current_day
         for state in self._binary_db.get_states():
             count = len(self._binary_db.get_packages_in_state(state))
             header += ", %s" % state
@@ -686,7 +693,10 @@
         countsfile = os.path.join(self._output_directory, "counts.txt") 
         if not os.path.isfile(countsfile):
           write_file(countsfile, header)
-        append_file(countsfile, counts)
+        else:
+          last_line = read_file(countsfile)[-1]
+        if not current_day in last_line:
+          append_file(countsfile, counts)
 
     def find_log(self, package):
         n = self._binary_db._logdb._log_name(package["Package"], package["Version"])




More information about the Piuparts-commits mailing list