Author: fw Date: 2005-09-15 15:40:40 +0000 (Thu, 15 Sep 2005) New Revision: 2005 Modified: lib/python/bugs.py Log: lib/python/bugs.py (BugFromDB.getSourcePackages): Add. Needs more work. (BugFromDB.getBinaryPackages): Sort by version (and package name). This makes the output somewhat more tolerable. Modified: lib/python/bugs.py ==================================================================--- lib/python/bugs.py 2005-09-15 15:39:01 UTC (rev 2004) +++ lib/python/bugs.py 2005-09-15 15:40:40 UTC (rev 2005) @@ -363,8 +363,25 @@ AND debian_bugs.note = package_notes.id ORDER BY bug""", (self.name,))) + def getSourcePackages(self, cursor): + # FIXME: Should perform aggregation. + + result = [] + for (package, release, subrelease, version, vulnerable) \ + in cursor.execute( + """SELECT p.name, p.release, p.subrelease, p.version, + s.vulnerable + FROM source_packages AS p, source_package_status AS s, + package_notes AS n + WHERE n.bug_name = ? AND s.note = n.id AND p.rowid = s.package + ORDER BY p.name, p.version_id""", + (self.name,)): + result.append((package, release, subrelease, version, vulnerable)) + + return result + def getBinaryPackages(self, cursor): - # FIXME: This should aggregate, possibly using group_by. + # FIXME: This should aggregated, possibly using group_by. result = [] @@ -386,7 +403,8 @@ s.vulnerable FROM binary_packages AS p, binary_package_status AS s, package_notes AS n - WHERE n.bug_name = ? AND s.note = n.id AND p.rowid = s.package""", + WHERE n.bug_name = ? AND s.note = n.id AND p.rowid = s.package + ORDER BY p.name, p.version_id""", (self.name,)): for arch in archs.split('',''): result.append((package, release, subrelease, version, arch,