[Secure-testing-commits] r42843 - bin
Chris Lamb
lamby at moszumanska.debian.org
Tue Jun 28 07:53:01 UTC 2016
Author: lamby
Date: 2016-06-28 07:53:01 +0000 (Tue, 28 Jun 2016)
New Revision: 42843
Added:
bin/unsupported_packages.py
Modified:
bin/lts-cve-triage.py
Log:
Ignore unsupported packages.
Modified: bin/lts-cve-triage.py
===================================================================
--- bin/lts-cve-triage.py 2016-06-28 07:22:01 UTC (rev 42842)
+++ bin/lts-cve-triage.py 2016-06-28 07:53:01 UTC (rev 42843)
@@ -19,6 +19,7 @@
import collections
from tracker_data import TrackerData, RELEASES
+from unsupported_packages import UnsupportedPackages
LIST_NAMES = (
('triage_already_in_dsa_needed',
@@ -56,7 +57,9 @@
parser.add_argument('--exclude', nargs='+', choices=[x[0] for x in LIST_NAMES],
help='Do not report on the specified lists')
args = parser.parse_args()
+
tracker = TrackerData(update_cache=not args.skip_cache_update)
+unsupported = UnsupportedPackages(update_cache=not args.skip_cache_update)
def add_to_list(key, pkg, issue):
assert key in [l[0] for l in LIST_NAMES]
@@ -66,6 +69,9 @@
if args.skip_dla_needed and pkg in tracker.dla_needed:
continue
+ if pkg in unsupported:
+ continue
+
for issue in tracker.iterate_pkg_issues(pkg):
status_in_lts = issue.get_status('lts')
status_in_next_lts = issue.get_status('next_lts')
Added: bin/unsupported_packages.py
===================================================================
--- bin/unsupported_packages.py (rev 0)
+++ bin/unsupported_packages.py 2016-06-28 07:53:01 UTC (rev 42843)
@@ -0,0 +1,55 @@
+# Copyright 2016 Chris Lamb <lamby at 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'))
More information about the Secure-testing-commits
mailing list