]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
Fix syntax and don't try to read empty cache
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 17 Jan 2021 18:19:20 +0000 (19:19 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 17 Jan 2021 18:19:20 +0000 (19:19 +0100)
bin/pfa-lintpkg

index 716cd88040cdaee03dae58fb875cabf9ef4317ec..5124a3c76263f0b7b1a440220ed349dac9b10e5d 100755 (executable)
@@ -99,7 +99,7 @@ class LintPkg:
 
     def get_stats(self, file):
         cachefile = self.cachefile(file)
-        if not os.path.exists(cachefile):
+        if not os.path.exists(cachefile) or os.path.getsize(cachefile) <= 0:
             return None
 
         # show last line (that contains status)
@@ -131,7 +131,7 @@ class LintPkg:
     def print_stats(self, file = None):
         if file:
             (dirname, filename) = os.path.split(file)
-            print("\r\033[0K%d packages and %d specfiles checked; %d errors, %d warnings. [%s]" % (self.packages, self.specfiles, self.errors, self.warnings, filename),, file=self.outstream)
+            print("\r\033[0K%d packages and %d specfiles checked; %d errors, %d warnings. [%s]" % (self.packages, self.specfiles, self.errors, self.warnings, filename), file=self.outstream)
         else:
             print("\r\033[0K%d packages and %d specfiles checked; %d errors, %d warnings." % (self.packages, self.specfiles, self.errors, self.warnings), file=self.outstream)
         sys.stdout.flush()
This page took 0.313208 seconds and 4 git commands to generate.