]> err.no Git - dak/commitdiff
process-upload: Add counter for rejected packages
authorAnsgar Burchardt <ansgar@debian.org>
Sat, 26 Mar 2011 22:26:55 +0000 (22:26 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Sat, 26 Mar 2011 22:26:55 +0000 (22:26 +0000)
Signed-off-by: Ansgar Burchardt <ansgar@debian.org>
dak/process_upload.py
daklib/queue.py
daklib/summarystats.py

index 22c333c9910a86cf8148492f28a18ea1c724a1e2..12e25a3352316be03144f6c12f9d1facfa1c98fb 100755 (executable)
@@ -503,6 +503,13 @@ def main():
                                                 utils.size_type(int(summarystats.accept_bytes)))
         Logger.log(["total", summarystats.accept_count, summarystats.accept_bytes])
 
+    if summarystats.reject_count:
+        sets = "set"
+        if summarystats.reject_count > 1:
+            sets = "sets"
+        print "Rejected %d package %s." % (summarystats.reject_count, sets)
+        Logger.log(["rejected", summarystats.reject_count])
+
     byebye()
 
     if not Options["No-Action"]:
index 6317e5bac6e2650004b5d757c8d3d33015b25da0..c81ef8ea20fbee5dd0f8a2918a2447a4ea142c7d 100755 (executable)
@@ -2451,6 +2451,8 @@ distribution."""
         if self.logger:
             self.logger.log(["rejected", self.pkg.changes_file])
 
+        stats = SummaryStats()
+        stats.reject_count += 1
         return 0
 
     ################################################################################
index 60702c3d10d3535de7df32cebe1e7a9ea5df95a9..f678ec25e487a1b4fa9fa6cfd9e40716eebffaba 100644 (file)
@@ -35,8 +35,11 @@ class SummaryStats(object):
         if not getattr(self, 'initialised', False):
             self.initialised = True
             self.reset_accept()
+            self.reset_reject()
 
     def reset_accept(self):
         self.accept_count = 0
         self.accept_bytes = 0
 
+    def reset_reject(self):
+        self.reject_count = 0