diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-02-04 12:56:24 +0000 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-02-04 12:56:24 +0000 |
commit | 99f3c52e5d84e96eff49ec797cece3b8f76140be (patch) | |
tree | 72762122e813489600de48835b003cdffa427921 /bin/unsupported_packages.py | |
parent | 1f7d10a1adf8153e22b5caecde1790a0332f5977 (diff) |
lts-cve-triage: Allow to ignore packages with limited support
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@48706 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/unsupported_packages.py')
-rw-r--r-- | bin/unsupported_packages.py | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/bin/unsupported_packages.py b/bin/unsupported_packages.py index ffc0628847..134f779379 100644 --- a/bin/unsupported_packages.py +++ b/bin/unsupported_packages.py @@ -19,28 +19,18 @@ import requests re_line = re.compile(r'(?!#)(?P<pkg>[^\s]+)') -class UnsupportedPackages(set): - URL = "https://anonscm.debian.org/cgit/collab-maint/debian-security-support.git/plain/security-support-ended.deb{}" - CACHED_DATA_PATH = "~/.cache/security-support-ended.deb{}" - - def __init__(self, debian_version=7, update_cache=True): - self.debian_version = debian_version - - self.cache = os.path.expanduser(self.CACHED_DATA_PATH).format( - self.debian_version, - ) +class DebSecSupport(set): + def __init__(self, update_cache): if update_cache: self.update_cache() self.load() def update_cache(self): - url = self.URL.format(self.debian_version) - - print("Updating {} from {} ...".format(self.cache, url)) + print("Updating {} from {} ...".format(self.cache, self.url)) - response = requests.get(url, allow_redirects=True) + response = requests.get(self.url, allow_redirects=True) response.raise_for_status() with open(self.cache, 'w') as f: @@ -53,3 +43,28 @@ class UnsupportedPackages(set): if m is not None: self.add(m.group('pkg')) + + +class UnsupportedPackages(DebSecSupport): + URL = "https://anonscm.debian.org/cgit/collab-maint/debian-security-support.git/plain/security-support-ended.deb{}" + CACHED_DATA_PATH = "~/.cache/security-support-ended.deb{}" + + def __init__(self, debian_version=7, update_cache=True): + self.debian_version = debian_version + self.url = self.URL.format(self.debian_version) + + self.cache = os.path.expanduser(self.CACHED_DATA_PATH).format( + self.debian_version, + ) + + super(UnsupportedPackages, self).__init__(update_cache) + + +class LimitedSupportPackages(DebSecSupport): + URL = "https://anonscm.debian.org/cgit/collab-maint/debian-security-support.git/plain/security-support-limited" + CACHED_DATA_PATH = "~/.cache/security-support-limited" + + def __init__(self, update_cache=True): + self.url = self.URL + self.cache = os.path.expanduser(self.CACHED_DATA_PATH) + super(LimitedSupportPackages, self).__init__(update_cache) |