summaryrefslogtreecommitdiffstats
path: root/lib/python/bugs.py
diff options
context:
space:
mode:
authorSalvatore Bonaccorso <carnil@debian.org>2014-09-01 10:40:19 +0000
committerSalvatore Bonaccorso <carnil@debian.org>2014-09-01 10:40:19 +0000
commit3474db5ee3ad12e1ecb27ef96de8ebfae4ae1269 (patch)
treef3f9e1c368d4b597e517b69851a6666caf859c41 /lib/python/bugs.py
parentef80d50ca084daef2960dc8263201fd30fb6c647 (diff)
add support for squeeze-lts (Closes: #759727 once Florian has applied this to soler.d.o)
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@28539 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib/python/bugs.py')
-rw-r--r--lib/python/bugs.py47
1 files changed, 44 insertions, 3 deletions
diff --git a/lib/python/bugs.py b/lib/python/bugs.py
index 49ccf04ab4..70108ffb43 100644
--- a/lib/python/bugs.py
+++ b/lib/python/bugs.py
@@ -418,9 +418,9 @@ class FileBase(debian_support.PackageFile):
re_whitespace = re.compile(r'\s+')
re_xref_entry = re.compile('^(?:CVE-\d{4}-\d{4,}'
+ r'|VU#\d{6}'
- + r'|DSA-\d+(?:-\d+)?|DTSA-\d+-\d+)$')
+ + r'|DSA-\d+(?:-\d+)?|DTSA-\d+-\d+|DLA-\d+-\d+)$')
re_xref_entry_own = re.compile(
- '^(?:CVE-\d{4}-\d{4,}|DSA-\d+(?:-\d+)?|DTSA-\d+-\d+)$')
+ '^(?:CVE-\d{4}-\d{4,}|DSA-\d+(?:-\d+)?|DTSA-\d+-\d+|DLA-\d+-\d+)$')
re_package_required = re.compile(r'^(?:\[.*\]\s*)?-')
re_package_version = re.compile(
@@ -808,7 +808,48 @@ class DSAFile(FileBase):
# Merge identical package notes, for historical reasons.
bug.mergeNotes()
return bug
-
+
+class DLAFile(FileBase):
+ """A DLA file.
+
+ Similar to a CVE file, only that it contains DLAs as its main
+ reference point, and release dates.
+ """
+
+ re_dsa = re.compile(r'^\[(\d\d) ([A-Z][a-z][a-z]) (\d{4})\] '
+ + r'(DLA-\d+(?:-\d+)?)\s+'
+ + r'(.*?)\s*$')
+
+ month_names = {'Jan': 1,
+ 'Feb': 2,
+ 'Mar': 3,
+ 'Apr': 4,
+ 'May': 5,
+ 'Jun': 6,
+ 'Jul': 7,
+ 'Aug': 8,
+ 'Sep': 9,
+ 'Oct': 10,
+ 'Nov': 11,
+ 'Dec': 12}
+
+ def matchHeader(self, line):
+ match = self.re_dsa.match(line)
+ if not match:
+ self.raiseSyntaxError("expected DLA record, got: %s" % `line`)
+ (record_name, description) = match.groups()
+ (day, month, year, name, desc) = match.groups()
+ try:
+ month = self.month_names[month]
+ except KeyError:
+ self.raiseSyntaxError("invalid month name %s" % `month`)
+ return ("%s-%02d-%s" % (year, month, day), name, desc)
+
+ def finishBug(self, bug):
+ # Merge identical package notes, for historical reasons.
+ bug.mergeNotes()
+ return bug
+
class DTSAFile(FileBase):
"""A DTSA file.

© 2014-2024 Faster IT GmbH | imprint | privacy policy