From: Ansgar Burchardt Date: Sat, 26 Mar 2011 22:26:55 +0000 (+0000) Subject: process-upload: Add counter for rejected packages X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=101a50f618031e5fde966959a1e57cc4d5287655;p=dak process-upload: Add counter for rejected packages Signed-off-by: Ansgar Burchardt --- diff --git a/dak/process_upload.py b/dak/process_upload.py index 22c333c9..12e25a33 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -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"]: diff --git a/daklib/queue.py b/daklib/queue.py index 6317e5ba..c81ef8ea 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -2451,6 +2451,8 @@ distribution.""" if self.logger: self.logger.log(["rejected", self.pkg.changes_file]) + stats = SummaryStats() + stats.reject_count += 1 return 0 ################################################################################ diff --git a/daklib/summarystats.py b/daklib/summarystats.py index 60702c3d..f678ec25 100644 --- a/daklib/summarystats.py +++ b/daklib/summarystats.py @@ -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