Author: fw Date: 2006-12-10 19:36:34 +0100 (Sun, 10 Dec 2006) New Revision: 5103 Modified: bin/tracker_service.py lib/python/bugs.py lib/python/security_db.py Log: Various changes to switch from FAKE- to TEMP- prefixes (Yeah, less than stellar engineering that this isn''t concentrated in a single place.) Modified: bin/tracker_service.py ==================================================================--- bin/tracker_service.py 2006-12-10 18:14:32 UTC (rev 5102) +++ bin/tracker_service.py 2006-12-10 18:36:34 UTC (rev 5103) @@ -204,12 +204,12 @@ # Redirect to start page. return RedirectResult(url.scriptRelativeFull("")) - # Attempt to decode a bug number. FAKE-nnn bugs (but not - # FAKE-nnn-mmm bugs) are treated as bug references, too. + # Attempt to decode a bug number. TEMP-nnn bugs (but not + # TEMP-nnn-mmm bugs) are treated as bug references, too. bugnumber = 0 fake_bug = False try: - if obj[0:5] == ''FAKE-'': + if obj[0:5] == ''FAKE-'' or obj[0:5] == ''TEMP-'': bugnumber = int(obj[5:]) fake_bug = True else: @@ -270,7 +270,7 @@ source_xref = self.make_dsa_ref(url, bug.name, ''Debian'') elif source == ''DTSA'': source_xref = ''Debian Testing Security Team'' - elif source == ''FAKE'': + elif source == ''TEMP'': source_xref = ( ''Automatically generated temporary name. Not for external reference.'') else: @@ -423,7 +423,7 @@ new_buglist = [] for b in buglist: (bug_name, urgency, description) = b - if bug_name[0:5] == "FAKE-": + if bug_name[0:5] == ''FAKE-'' or bug_name[0:5] == ''TEMP-'': new_buglist.append(b) if len(new_buglist) > 0: # Only replace the bug list if there are still fake @@ -913,7 +913,7 @@ """SELECT package, string_set(bug_name) FROM package_notes AS p1 WHERE release <> '''' - AND (bug_name LIKE ''CVE-%'' OR bug_name LIKE ''FAKE-%'') + AND (bug_name LIKE ''CVE-%'' OR bug_name LIKE ''TEMP-%'') AND NOT EXISTS (SELECT 1 FROM package_notes AS p2 WHERE p2.bug_name = p1.bug_name AND p2.package = p1.package @@ -932,7 +932,7 @@ FROM package_notes AS p1 WHERE release <> '''' AND urgency <> ''unimportant'' - AND (bug_name LIKE ''CVE-%'' OR bug_name LIKE ''FAKE-%'') + AND (bug_name LIKE ''CVE-%'' OR bug_name LIKE ''TEMP-%'') AND EXISTS (SELECT 1 FROM package_notes AS p2 WHERE p2.bug_name = p1.bug_name AND p2.package = p1.package @@ -1026,7 +1026,7 @@ a unique name. These names are not stable and can change when the database is updated, so they should not be used in external references."""), P(''''''The automatically generated names come in two flavors: -the first kind starts with the string "'''''', CODE("FAKE-000000-"), +the first kind starts with the string "'''''', CODE("TEMP-000000-"), ''''''". This means that no Debian bug has been assigned to this issue (or a bug has been created and is not recorded in this database). In the second kind of names, there is a Debian bug for the issue, and the "'''''', Modified: lib/python/bugs.py ==================================================================--- lib/python/bugs.py 2006-12-10 18:14:32 UTC (rev 5102) +++ lib/python/bugs.py 2006-12-10 18:36:34 UTC (rev 5103) @@ -761,7 +761,7 @@ break if first_bug: break - record_name = ''FAKE-%07d-%06d'' % (first_bug, first_lineno) + record_name = ''TEMP-%07d-%06d'' % (first_bug, first_lineno) yield self.finishBug(Bug(self.file.name, first_lineno, date, record_name, description, comments, notes=pkg_notes, xref=xref)) Modified: lib/python/security_db.py ==================================================================--- lib/python/security_db.py 2006-12-10 18:14:32 UTC (rev 5102) +++ lib/python/security_db.py 2006-12-10 18:36:34 UTC (rev 5103) @@ -1299,7 +1299,7 @@ else: release = ''sid'' - c.execute("""DELETE FROM vulnlist WHERE name LIKE ''FAKE-0000000-%''""") + c.execute("""DELETE FROM vulnlist WHERE name LIKE ''TEMP-0000000-%''""") urgency_to_flag = {''low'' : ''L'', ''medium'' : ''M'', ''high'' : ''H'', ''unknown'' : '' ''} @@ -1326,7 +1326,7 @@ # makes the name unique) is completely useless for the # client. - if name[0:5] == "FAKE-": + if name[0:5] == ''TEMP-'': name = ''-''.join(name.split(''-'')[0:2]) # Determine if a fix is available for the specific @@ -1405,8 +1405,8 @@ (SELECT range_remote FROM nvd_data WHERE cve_name = p.bug_name) FROM package_notes AS p, bugs AS b - WHERE (p.bug_name LIKE ''CVE-%'' OR p.bug_name LIKE ''FAKE-%'') - AND p.bug_name NOT LIKE ''FAKE-0000000-%'' + WHERE (p.bug_name LIKE ''CVE-%'' OR p.bug_name LIKE ''TEMP-%'') + AND p.bug_name NOT LIKE ''TEMP-0000000-%'' AND p.urgency <> ''unimportant'' AND COALESCE(p.fixed_version, '''') <> ''0'' AND p.package_kind IN (''source'', ''binary'', ''unknown'') @@ -1423,7 +1423,7 @@ # makes the name unique) is completely useless for the # client. - if bug[0:5] == "FAKE-": + if bug[0:5] == ''TEMP-'': name = ''-''.join(bug.split(''-'')[0:2]) else: name = bug @@ -1444,8 +1444,8 @@ for (bug, package) in list(c.execute( """SELECT DISTINCT bug_name, package FROM package_notes - WHERE (bug_name LIKE ''CVE-%'' OR bug_name LIKE ''FAKE-%'') - AND bug_name NOT LIKE ''FAKE-0000000-%'' + WHERE (bug_name LIKE ''CVE-%'' OR bug_name LIKE ''TEMP-%'') + AND bug_name NOT LIKE ''TEMP-0000000-%'' AND package_kind IN (''source'', ''binary'', ''unknown'') GROUP BY package, bug_name ORDER BY package, bug_name""")): @@ -1906,7 +1906,7 @@ return list(cursor.execute( """SELECT name, description FROM bugs - WHERE name > ''FAKE-'' AND name LIKE ''FAKE-%'' + WHERE name > ''TEMP-'' AND name LIKE ''TEMP-%'' ORDER BY name""")) def getITPs(self, cursor):