From: Jan Rękorajski Date: Sun, 17 Jan 2021 18:19:20 +0000 (+0100) Subject: Fix syntax and don't try to read empty cache X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=434e50be88b605c132f7ad5b7f73e5cfedb61d66;p=projects%2Fpld-ftp-admin.git Fix syntax and don't try to read empty cache --- diff --git a/bin/pfa-lintpkg b/bin/pfa-lintpkg index 716cd88..5124a3c 100755 --- a/bin/pfa-lintpkg +++ b/bin/pfa-lintpkg @@ -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()