Author: fw Date: 2005-10-20 09:03:14 +0000 (Thu, 20 Oct 2005) New Revision: 2486 Modified: lib/python/security_db.py Log: r629@deneb: fw | 2005-10-14 11:01:25 +0200 lib/python/security_db.py (DB._calcTesting): Change so that it works for stable as well. (DB.calculateVulnerabilities): Invoke _calcTesting for both stable and testing. Modified: lib/python/security_db.py ==================================================================--- lib/python/security_db.py 2005-10-20 09:03:03 UTC (rev 2485) +++ lib/python/security_db.py 2005-10-20 09:03:14 UTC (rev 2486) @@ -1091,7 +1091,8 @@ "SELECT name FROM bugs WHERE NOT not_for_us"): self._calcUnstable(c, bug_name) - self._calcTesting(c, bug_name) + self._calcTesting(c, bug_name, ''testing'', ''etch'') + self._calcTesting(c, bug_name, ''stable'', ''sarge'') return result @@ -1134,8 +1135,8 @@ VALUES (?, ''unstable'', ''fixed'', ?)""", (bug_name, status)) - def _calcTesting(self, cursor, bug_name): - """Update bug_status with bug_name for unstable.""" + def _calcTesting(self, cursor, bug_name, suite, nickname): + """Update bug_status with bug_name for testing/stable.""" # Note that there is at most one source package per # note/release/subrelease triple, but we should check that @@ -1148,11 +1149,11 @@ FROM source_package_status AS st, source_packages AS sp, package_notes AS n WHERE st.bug_name = ? AND sp.rowid = st.package - AND sp.release = ''etch'' AND sp.subrelease IN ('''', ''security'') + AND sp.release = ? AND sp.subrelease IN ('''', ''security'') AND n.bug_name = st.bug_name AND n.package = sp.name AND n.urgency <> ''unimportant'' ORDER BY sp.name""", - (bug_name,)): + (bug_name, nickname)): status[subrelease][(package, note)] = vulnerable # Check if any packages in plain testing are vulnerable, and @@ -1174,8 +1175,8 @@ msg = "not vulnerable" cursor.execute("""INSERT INTO bug_status (bug_name, release, status, reason) - VALUES (?, ''testing'', ''fixed'', ?)""", - (bug_name, msg)) + VALUES (?, ?, ''fixed'', ?)""", + (bug_name, suite, msg)) return if len(pkgs) == 1: @@ -1183,16 +1184,19 @@ else: pkgs = "packages " + ", ".join(pkgs) + " are " if fixed_in_security: - pkgs += "fixed in testing-security" - status = "partially-fixed" + pkgs = "%sfixed in %s-security" % (pkgs, suite) + if suite == ''stable'': + status = ''fixed'' + else: + status = "partially-fixed" else: pkgs += "vulnerable" status = "vulnerable" cursor.execute("""INSERT INTO bug_status (bug_name, release, status, reason) - VALUES (?, ''testing'', ?, ?)""", - (bug_name, status, pkgs)) + VALUES (?, ?, ?, ?)""", + (bug_name, suite, status, pkgs)) def getSourcePackageVersions(self, cursor, pkg): """A generator which returns tuples (RELEASE-LIST, VERSION),