[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.44-836-g931cbb1

Andreas Beckmann debian at abeckmann.de
Thu Jun 21 11:36:01 UTC 2012


The following commit has been merged in the develop branch:
commit 931cbb177f9e260dade137cef08b6da8a862d5e4
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Thu Jun 21 13:19:38 2012 +0200

    p-s: record timestamp for all submitted logs in submissions.txt
    
    Store tuples (timestamp, category, package, version)
    as space separated text in MASTER/SECTION/submissions.txt.
    For future charts of processed packages ...
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index d8b9306..a47f3de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -132,6 +132,7 @@ piuparts (0.45) UNRELEASED; urgency=low
     - Remove known_circular_depends handling.
     - Reduce logfile verboseness: do not include received logs.
     - Always chdir to master_directory, do not rely on being run from there.
+    - Record timestamps of submitted logs in submissions.txt.
   * piuparts-slave.py:
     - Randomize waiting time (between 60 and 180 seconds) if master is busy.
     - Sleep until the next section can be tried, but at least 1 minute.
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 8a79595..d2530ad 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -283,6 +283,7 @@ class PackagesDB:
             pformat = self.prefix + "/%s"
         else:
             pformat = "%s"
+        self._submissions = pformat % "submissions.txt"
         if ok:
             self._ok = pformat % ok
         if fail:
@@ -573,6 +574,10 @@ class PackagesDB:
         if "/" in str:
             raise Exception("'/' in (partial) filename: %s" % str)
 
+    def _record_submission(self, category, package, version):
+        with open(self._submissions, "a") as submissions:
+            submissions.write("%d %s %s %s\n" % (time.time(), category, package, version))
+
     def unreserve_package(self, package, version):
         self._check_for_acceptability_as_filename(package)
         self._check_for_acceptability_as_filename(version)
@@ -583,6 +588,7 @@ class PackagesDB:
         self._check_for_acceptability_as_filename(version)
         if self._logdb.create(self._ok, package, version, log):
             self._logdb.remove(self._reserved, package, version)
+            self._record_submission("pass", package, version)
         else:
             raise Exception("Log file exists already: %s (%s)" %
                                 (package, version))
@@ -592,6 +598,7 @@ class PackagesDB:
         self._check_for_acceptability_as_filename(version)
         if self._logdb.create(self._fail, package, version, log):
             self._logdb.remove(self._reserved, package, version)
+            self._record_submission("fail", package, version)
         else:
             raise Exception("Log file exists already: %s (%s)" %
                                 (package, version))
@@ -601,6 +608,7 @@ class PackagesDB:
         self._check_for_acceptability_as_filename(version)
         if self._logdb.create(self._evil, package, version, log):
             self._logdb.remove(self._reserved, package, version)
+            self._record_submission("untestable", package, version)
         else:
             raise Exception("Log file exists already: %s (%s)" %
                                 (package, version))

-- 
piuparts git repository



More information about the Piuparts-commits mailing list