summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu@debian.org>2018-05-11 15:35:39 +0200
committerEmilio Pozuelo Monfort <pochu@debian.org>2018-06-08 08:38:46 +0200
commite41c7f36a0813a2d01dbabc784346d90d56828c4 (patch)
treedd9652e3fc6e7d6257573f7d556d869fdb0bdba8 /lib
parentff9d708119551538d447bc796c4ca2e2de4985a5 (diff)
Simplify DLAFile
Subclass DSAFile rather than copying it.
Diffstat (limited to 'lib')
-rw-r--r--lib/python/bugs.py37
1 files changed, 1 insertions, 36 deletions
diff --git a/lib/python/bugs.py b/lib/python/bugs.py
index b876647da9..6a042033b5 100644
--- a/lib/python/bugs.py
+++ b/lib/python/bugs.py
@@ -814,47 +814,12 @@ class DSAFile(FileBase):
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.
- """
-
+class DLAFile(DSAFile):
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