Author: fw
Date: 2005-09-23 11:29:09 +0000 (Fri, 23 Sep 2005)
New Revision: 2132
Modified:
lib/python/bugs.py
lib/python/security_db.py
Log:
lib/python/bugs.py (FileBase.__iter__):
Assign "unimportant" urgency to not-affected packages.
lib/python/security_db.py (DB.getBugsForSourcePackage,
DB.getBugsForBinaryPackage):
Filter out unimportant bugs.
(DB.getNonBugsForBinaryPackage):
New.
Modified: lib/python/bugs.py
==================================================================---
lib/python/bugs.py 2005-09-23 10:55:51 UTC (rev 2131)
+++ lib/python/bugs.py 2005-09-23 11:29:09 UTC (rev 2132)
@@ -648,7 +648,8 @@
if v == ''not-affected'':
# ''0'' is the minimum version
number possible.
pkg_notes.append(PackageNoteParsed
- (p, ''0'', None,
release=release))
+ (p, ''0'',
''unimportant'',
+ release=release))
# ''d'' is a free-form field in
this case,
# if it is present.
if d:
Modified: lib/python/security_db.py
==================================================================---
lib/python/security_db.py 2005-09-23 10:55:51 UTC (rev 2131)
+++ lib/python/security_db.py 2005-09-23 11:29:09 UTC (rev 2132)
@@ -1321,6 +1321,7 @@
FROM source_packages AS sp, source_package_status AS st, bugs
WHERE sp.name = ? AND st.package = sp.rowid
AND bugs.name = st.bug_name
+ AND st.urgency <> ''unimportant''
GROUP BY bugs.name, bugs.description)
WHERE vulnerable = ?
ORDER BY name""", (pkg, vulnerable))
@@ -1334,11 +1335,24 @@
MAX(st.vulnerable) AS vulnerable
FROM binary_packages AS bp, binary_package_status AS st, bugs
WHERE bp.name = ? AND st.package = bp.rowid
+ AND st.urgency <> ''unimportant''
AND bugs.name = st.bug_name
GROUP BY bugs.name, bugs.description)
WHERE vulnerable = ?
ORDER BY name""", (pkg, vulnerable))
+ def getNonBugsForBinaryPackage(self, cursor, pkg):
+ """Returns a generator for a list of (BUG, DESCRIPTION)
pairs
+ which have the requested status."""
+
+ return cursor.execute(
+ """SELECT DISTINCT bugs.name, bugs.description
+ FROM binary_packages AS bp, binary_package_status AS st, bugs
+ WHERE bp.name = ? AND st.package = bp.rowid
+ AND st.urgency = ''unimportant''
+ AND bugs.name = st.bug_name
+ ORDER BY bugs.name""", (pkg,))
+
def getTODOs(self, cursor=None):
"""Returns a list of pairs (BUG-NAME,
DESCRIPTION)."""
if cursor is None: