Author: fw Date: 2005-09-13 21:21:44 +0000 (Tue, 13 Sep 2005) New Revision: 1968 Modified: lib/python/bugs.py Log: Add a crude check to discover kernel-only bug reports. (I found a better way to deal with this situation, though.) lib/python/bugs.py (PackageNote.affectsKernel, BugBase.isKernelOnly): Add. Modified: lib/python/bugs.py ==================================================================--- lib/python/bugs.py 2005-09-13 21:19:29 UTC (rev 1967) +++ lib/python/bugs.py 2005-09-13 21:21:44 UTC (rev 1968) @@ -91,6 +91,11 @@ # Standard version comparison if the releases match. return self.fixed_version is None or version < self.fixed_version + def affectsKernel(self, regexp=re.compile + (r''^kernel-(?:source|image|patch)-[0-9.]{3}'')): + """Crude check if this is a kernel package.""" + return regexp.match(self.package) is not None + def fixedVersion(self): """ Returns a string noting that the bug was fixed, or ''unfixed''.""" if self.fixed_version: @@ -221,6 +226,15 @@ return True return False + def isKernelOnly(self): + """Returns True if this bug contains notes which refer to kernels.""" + if len(self.notes) == 0: + return False + for n in self.notes: + if not n.affectsKernel(): + return False + return True + def writeDB(self, cursor): """Writes the record to an SQLite3 database."""