diff options
author | Florian Weimer <fw@deneb.enyo.de> | 2010-05-09 14:19:12 +0000 |
---|---|---|
committer | Florian Weimer <fw@deneb.enyo.de> | 2010-05-09 14:19:12 +0000 |
commit | 4adef3c017907b400b6aba05f55c29000f77d787 (patch) | |
tree | 11b919f78ed95801a88960417b9e7386bff8d7ef /lib | |
parent | 5716950b36bcfb4c16699ebb89933f61bcae2b49 (diff) |
sectracker.parsers._parselist: detect conflict annotations
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@14657 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/sectracker/parsers.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/python/sectracker/parsers.py b/lib/python/sectracker/parsers.py index 7dff44f4e6..181b3e16d4 100644 --- a/lib/python/sectracker/parsers.py +++ b/lib/python/sectracker/parsers.py @@ -191,6 +191,8 @@ def _parselist(path, f, parseheader, finish): diag = sectracker.diagnostics.Diagnostics() header = None anns = [] + anns_types = set() + relpkg = set() for line in f.readlines(): lineno += 1 @@ -202,11 +204,30 @@ def _parselist(path, f, parseheader, finish): continue ann = _annotationdispatcher(line, diag) if ann is not None: + # Per-annotation checks (spanning multiple annotaitons) + anns_types.add(ann.type) + if ann.type == "package": + rp = (ann.release, ann.package) + if rp in relpkg: + diag.error("duplicate package annation") + ann = None + else: + relpkg.add(rp) + if ann is not None: anns.append(ann) else: if header is not None: + # Per-bug global checks + if "NOT-FOR-US" in anns_types and "package" in anns_types: + diag.error("NOT-FOR-US conflicts with package annotations", + line=headerlineno) + if "REJECTED" in anns_types and "package" in anns_types: + diag.warning("REJECTED bug has package annotations", + line=headerlineno) bugs.append(finish(header, headerlineno, anns, diag)) del anns[:] + anns_types = set() + relpkg = set() headerlineno = lineno header = parseheader(line) |