diff options
author | Emilio Pozuelo Monfort <pochu@debian.org> | 2022-08-18 15:50:22 +0200 |
---|---|---|
committer | Emilio Pozuelo Monfort <pochu@debian.org> | 2022-08-18 15:50:57 +0200 |
commit | 999e4cdf0d970523f250e3fe4b1a3da949237f6a (patch) | |
tree | a71e4430ea5fc933ffaeecba69f605860824972c /bin | |
parent | b0fc6ed2b07753633f823e1ac40a39a997b6e80b (diff) |
lts-missing-uploads: ignore DLAs for older releases
Otherwise we'll check the version in the old DLA against the current
LTS's Sources.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/lts-missing-uploads | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bin/lts-missing-uploads b/bin/lts-missing-uploads index 81caab0d27..655209e5e8 100755 --- a/bin/lts-missing-uploads +++ b/bin/lts-missing-uploads @@ -32,6 +32,10 @@ import config lts = config.get_supported_releases()[0] +class DLAForAnotherRelease(Exception): + pass + + class LTSMissingUploads(object): MONTHS = 6 SOURCES = ['http://security.debian.org/dists/{}/updates/{}/source/Sources.gz'.format(lts, component) @@ -52,8 +56,11 @@ class LTSMissingUploads(object): dlas = {} def download(x): self.info("{source}: parsing announcement from {url} ...", **x) - x.update(self.get_dla(x['url'])[0]) - dlas[x['source']] = x + try: + x.update(self.get_dla(x['url'])[0]) + dlas[x['source']] = x + except DLAForAnotherRelease: + pass for idx in range(self.MONTHS): dt = datetime.datetime.utcnow().replace(day=1) - \ @@ -118,7 +125,7 @@ class LTSMissingUploads(object): return result def get_dla(self, url): - return self.parse(url, self.re_version) + return self.parse(url, self.re_version, is_dla=True) def get_sources(self): pkgver = {} @@ -135,9 +142,14 @@ class LTSMissingUploads(object): return pkgver - def parse(self, url, pattern): + def parse(self, url, pattern, is_dla=False): result = [] + # if parsing a specific DLA (as opposed to the DLAs list), check + # if the DLA is for the current LTS release, and ignore if not + if is_dla and lts not in self.session.get(url).content.decode('utf-8'): + raise DLAForAnotherRelease + for x in self.session.get(url).content.splitlines(): m = pattern.search(x.decode('utf8')) |