Hi, see mail subject and attached file.
[00:53] < h01ger> | buxy: i have a patch to display end-of-life too, #642987 - i just dont like abusing urgency for it as i do. i'd rather have florians db remodelling.. but I might still commit this one to svn, as perfect is the enemy of good also here, and the EOL code can also be refactored, once the modell is redone :) cheers, Holger
From a96948b3ef4e4a40107cc8f00b9af584b6d26fb6 Mon Sep 17 00:00:00 2001 From: Holger Levsen <hol...@layer-acht.org> Date: Sat, 13 Sep 2014 02:02:42 +0200 Subject: [PATCH] Display end-of-life information in the web view. (Closes: #642987) --- bin/tracker_service.py | 7 ++++++- lib/python/bugs.py | 4 ++-- lib/python/security_db.py | 8 +++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bin/tracker_service.py b/bin/tracker_service.py index d3c8b10..83a53bd 100644 --- a/bin/tracker_service.py +++ b/bin/tracker_service.py @@ -29,6 +29,7 @@ class BugFilter: ('low_urgency', 'low', 'urgency'), ('unimportant_urgency', 'unimportant', 'urgency'), ('unassigned_urgency', 'not_yet_assigned', 'urgency'), + ('endoflife_urgency', 'end-of-life', 'urgency'), ('remote', 'hide remote scope', 'scope'), ('local', 'hide local scope', 'scope'), @@ -76,7 +77,9 @@ class BugFilter: and urg == 'unimportant' filteruna = not self.params['unassigned_urgency'] \ and urg == 'not yet assigned' - return filterlow or filtermed or filterhigh or filterund or filteruni or filteruna + filterend = not self.params['endoflife_urgency'] \ + and urg == 'end-of-life' + return filterlow or filtermed or filterhigh or filterund or filteruni or filteruna or filterend def remoteFiltered(self, remote): filterr = self.params['remote'] and remote and remote is not None @@ -420,6 +423,8 @@ data source.""")], else: rel = '(unstable)' urgency = str(n.urgency) + if urgency == 'end-of-life': + urgency = self.make_red('end-of-life') if n.fixed_version: ver = str(n.fixed_version) if ver == '0': diff --git a/lib/python/bugs.py b/lib/python/bugs.py index a147e74..9247085 100644 --- a/lib/python/bugs.py +++ b/lib/python/bugs.py @@ -24,7 +24,7 @@ class Urgency(debian_support.PseudoEnum): pass def listUrgencies(): urgencies = {} - urgs = ('high', 'medium', 'low', 'unimportant', 'not yet assigned') + urgs = ('high', 'medium', 'low', 'unimportant', 'end-of-life', 'not yet assigned') for u in range(len(urgs)): urgencies[urgs[u]] = Urgency(urgs[u], -u) Urgency.urgencies = urgencies @@ -579,7 +579,7 @@ class FileBase(debian_support.PackageFile): comments.append(('NOTE', r)) elif v == 'end-of-life': pkg_notes.append(PackageNoteParsed - (p, '0', 'unimportant', + (p, None, 'end-of-life', release=release)) if d: # Not exactly ideal, but we have to diff --git a/lib/python/security_db.py b/lib/python/security_db.py index 088d4b5..52abb93 100644 --- a/lib/python/security_db.py +++ b/lib/python/security_db.py @@ -274,7 +274,7 @@ class DB: subrelease TEXT NOT NULL, status TEXT NOT NULL CHECK (status IN ('vulnerable', 'fixed', 'unknown', 'undetermined', - 'partially-fixed', 'todo')), + 'partially-fixed', 'todo', 'end-of-life')), reason TEXT NOT NULL, PRIMARY KEY (bug_name, release, subrelease))""") @@ -1305,7 +1305,8 @@ class DB: AND n.id = vulnlist.note ORDER BY vulnlist.package""")): if fixed_version == '0' or urgency == 'unimportant' \ - or kind not in ('source', 'binary', 'unknown'): + or urgency == 'end-of-life' \ + or kind not in ('source', 'binary', 'unknown'): continue # Normalize FAKE-* names a bit. The line number (which @@ -1500,7 +1501,8 @@ class DB: # packages as vulnerable. (If unstable_fixed == '0', # release-specific annotations cannot create # vulnerabilities, either.) - if total_urgency == 'unimportant' or unstable_fixed == '0': + if total_urgency == 'unimportant' or unstable_fixed == '0' \ + or total_urgency == 'end-of-life': continue if unstable_fixed is None: -- 1.9.1
signature.asc
Description: This is a digitally signed message part.