summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu@debian.org>2019-11-28 11:13:02 +0100
committerEmilio Pozuelo Monfort <pochu@debian.org>2020-02-26 12:31:30 +0100
commita685790241179fbe6081299e19d012ebfe02746b (patch)
tree5c7275b380adc17da807ac529d1fb182afdedc92 /lib
parent4c113abef81eb5e490aceb765bb36971c660db01 (diff)
security_db: don't hardcode the testing suite codename
Diffstat (limited to 'lib')
-rw-r--r--lib/python/security_db.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/python/security_db.py b/lib/python/security_db.py
index d62ca6283b..910ba62375 100644
--- a/lib/python/security_db.py
+++ b/lib/python/security_db.py
@@ -464,6 +464,7 @@ class DB:
""")
def _initViews(self, cursor):
+ testing = config.get_release_codename('testing')
cursor.execute(
"""CREATE TEMPORARY VIEW testing_status AS
SELECT DISTINCT sp.name AS package, st.bug_name AS bug,
@@ -479,7 +480,7 @@ class DB:
COALESCE((SELECT NOT vulnerable
FROM source_packages AS tsecp, source_package_status AS tsecst
WHERE tsecp.name = sp.name
- AND tsecp.release = 'bullseye' AND tsecp.subrelease = 'security'
+ AND tsecp.release = '%s' AND tsecp.subrelease = 'security'
AND tsecp.archive = sp.archive
AND tsecst.bug_name = st.bug_name
AND tsecst.package = tsecp.rowid), 0) AS testing_security_fixed,
@@ -488,11 +489,12 @@ class DB:
(EXISTS (SELECT * FROM package_notes_nodsa AS pnd
WHERE pnd.bug_name = st.bug_name
AND pnd.package = sp.name
- AND pnd.release = 'bullseye')) AS no_dsa
+ AND pnd.release = '%s')) AS no_dsa
FROM source_package_status AS st, source_packages AS sp
WHERE st.vulnerable > 0 AND sp.rowid = st.package
- AND sp.release = 'bullseye' AND sp.subrelease = ''
- ORDER BY sp.name, st.urgency, st.bug_name""")
+ AND sp.release = '%s' AND sp.subrelease = ''
+ ORDER BY sp.name, st.urgency, st.bug_name"""
+ % (testing, testing, testing))
releases = (('stable', config.get_release_codename('stable')),
('oldstable', config.get_release_codename('oldstable')),
@@ -1144,7 +1146,7 @@ class DB:
"""Calculate vulnerable packages.
To each package note, a release-specific vulnerability status
- is attached. Currently, only bullseye/testing is processed.
+ is attached. Currently, only testing is processed.
Returns a list strings describing inconsistencies.
"""
@@ -1160,17 +1162,18 @@ class DB:
# The following does not work because stable->security ->
# testing -> unstable propagation is no longer available.
if False:
- # Ignore bullseye/testing because stable issues may be
+ # Ignore testing because stable issues may be
# fast-tracked into testing, bypassing unstable.
+ testing = config.get_release_codename('testing')
for (bug_name, pkg_name, rel, unstable_ver, rel_ver) \
in list(cursor.execute(
"""SELECT a.bug_name, a.package, b.release,
a.fixed_version, b.fixed_version
FROM package_notes a, package_notes b
WHERE a.bug_name = b.bug_name AND a.package = b.package
- AND a.release = '' AND b.release NOT IN ('', 'bullseye')
+ AND a.release = '' AND b.release NOT IN ('', '%s')
AND a.fixed_version IS NOT NULL
- AND a.fixed_version_id < b.fixed_version_id""")):
+ AND a.fixed_version_id < b.fixed_version_id""" % (testing,))):
b = bugs.BugFromDB(cursor, bug_name)
result.append("%s:%d: inconsistent versions for package %s"
% (b.source_file, b.source_line, pkg_name))

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