self._rpmlint = '/usr/bin/rpmlint'
+ # mtime, which invalidates all caches
+ self.mtime = None
+ rpmlintrc = os.path.expanduser("~/.config/rpmlint")
+ if os.path.exists(rpmlintrc):
+ self.mtime = os.stat(rpmlintrc).st_mtime
+
self.cachedir = os.path.expanduser(cachedir)
if not os.path.isdir(self.cachedir):
os.makedirs(self.cachedir)
cachefile = self.cachefile(file)
rc = None
- if not os.path.exists(cachefile) or os.stat(file).st_mtime > os.stat(cachefile).st_mtime:
+ if not os.path.exists(cachefile) \
+ or os.stat(file).st_mtime > os.stat(cachefile).st_mtime \
+ or (self.mtime and self.mtime > os.stat(cachefile).st_mtime):
cmd = [self._rpmlint, file]
outfd = open(cachefile, 'w')
try: