diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2018-06-01 15:38:19 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2018-06-08 08:38:46 +0200 |
commit | 85358069b8a1cdf6ba0859d425c7e5fe44d5b498 (patch) | |
tree | 53053385365f2214a9cfe82508ee232852a93f20 /lib | |
parent | e41c7f36a0813a2d01dbabc784346d90d56828c4 (diff) |
Merge DLAFile into DSAFile
The only difference is that the regular expressions look for DSA
or DLA, but we can just guess that based on the path.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/bugs.py | 18 | ||||
-rw-r--r-- | lib/python/security_db.py | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/python/bugs.py b/lib/python/bugs.py index 6a042033b5..278e2ab79e 100644 --- a/lib/python/bugs.py +++ b/lib/python/bugs.py @@ -16,6 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA import debian_support +import os import re import types import hashlib @@ -780,9 +781,13 @@ class DSAFile(FileBase): reference point, and release dates. """ - re_dsa = re.compile(r'^\[(\d\d) ([A-Z][a-z][a-z]) (\d{4})\] ' - + r'(DSA-\d+(?:-\d+)?)\s+' - + r'(.*?)\s*$') + def __init__(self, name, fileObj=None): + FileBase.__init__(self, name, fileObj) + + self.base = os.path.basename(os.path.dirname(self.name)) + self.re_dsa = re.compile(r'^\[(\d\d) ([A-Z][a-z][a-z]) (\d{4})\] ' + + r'(' + self.base + '-\d+(?:-\d+)?)\s+' + + r'(.*?)\s*$') month_names = {'Jan': 1, 'Feb': 2, @@ -800,7 +805,7 @@ class DSAFile(FileBase): def matchHeader(self, line): match = self.re_dsa.match(line) if not match: - self.raiseSyntaxError("expected DSA record, got: %s" % `line`) + self.raiseSyntaxError("expected %s record, got: %s" % (self.base, `line`)) (record_name, description) = match.groups() (day, month, year, name, desc) = match.groups() try: @@ -814,11 +819,6 @@ class DSAFile(FileBase): bug.mergeNotes() return bug -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*$') - class DTSAFile(FileBase): """A DTSA file. diff --git a/lib/python/security_db.py b/lib/python/security_db.py index 9208532fba..dbb7cd8048 100644 --- a/lib/python/security_db.py +++ b/lib/python/security_db.py @@ -916,7 +916,7 @@ class DB: sources = ((bugs.CVEFile, '/CVE/list'), (bugs.DSAFile, '/DSA/list'), (bugs.DTSAFile, '/DTSA/list'), - (bugs.DLAFile, '/DLA/list'), + (bugs.DSAFile, '/DLA/list'), (None, source_removed_packages)) unchanged = True |