summaryrefslogtreecommitdiffstats
path: root/bin/unsupported_packages.py
diff options
context:
space:
mode:
authorChris Lamb <lamby@debian.org>2016-06-28 07:53:01 +0000
committerChris Lamb <lamby@debian.org>2016-06-28 07:53:01 +0000
commit895e0ac13d657adc213ae65f1dbe7fb896038b3b (patch)
tree2fca66a7f6d9b5416fad1a36d761e7e6731e95dd /bin/unsupported_packages.py
parentf216712df6f6d9c2690c35a4295325fdb43d3ac9 (diff)
Ignore unsupported packages.
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@42843 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/unsupported_packages.py')
-rw-r--r--bin/unsupported_packages.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/bin/unsupported_packages.py b/bin/unsupported_packages.py
new file mode 100644
index 0000000000..ffc0628847
--- /dev/null
+++ b/bin/unsupported_packages.py
@@ -0,0 +1,55 @@
+# Copyright 2016 Chris Lamb <lamby@debian.org>
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file. If not, see <https://www.gnu.org/licenses/>.
+
+import os
+import re
+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,
+ )
+
+ 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))
+
+ response = requests.get(url, allow_redirects=True)
+ response.raise_for_status()
+
+ with open(self.cache, 'w') as f:
+ f.write(response.text)
+
+ def load(self):
+ with open(self.cache, 'r') as f:
+ for x in f.readlines():
+ m = re_line.match(x)
+
+ if m is not None:
+ self.add(m.group('pkg'))

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