Sylvain Beucler pushed to branch master at Debian Security Tracker /
security-tracker
Commits:
140585ae by Sylvain Beucler at 2025-07-09T16:53:23+02:00
lts-cve-triage: fix cache freshness detection
The current code writes "b'<git revision>'" instead of "<git revision>" in the
.rev file.
Apparently introduced back in 6ab7f10fd0ec46356e2b430ace597c6211b48c15
- - - - -
1 changed file:
- bin/tracker_data.py
Changes:
=====================================
bin/tracker_data.py
=====================================
@@ -32,7 +32,7 @@ class TrackerData(object):
CACHED_DATA_PATH = "~/.cache/debian_security_tracker.json"
CACHED_REVISION_PATH = "~/.cache/debian_security_tracker.rev"
GET_REVISION_COMMAND = \
- "LC_ALL=C git ls-remote %s | awk '/HEAD$/ { print $1 }'" % GIT_URL
+ "LC_ALL=C git ls-remote %s HEAD | cut -f1" % GIT_URL
DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data')
def __init__(self, update_cache=True):
@@ -61,7 +61,7 @@ class TrackerData(object):
"""Verify if the cache is out of date"""
if os.path.exists(self.cached_data_path) and os.path.exists(
self.cached_revision_path):
- with open(self.cached_revision_path, 'r') as f:
+ with open(self.cached_revision_path, 'rb') as f:
try:
revision = f.read()
except ValueError:
@@ -84,8 +84,8 @@ class TrackerData(object):
os.mkdir(self.cached_data_dir, mode=0o700)
with open(self.cached_data_path, 'w') as cache_file:
cache_file.write(response.text)
- with open(self.cached_revision_path, 'w') as rev_file:
- rev_file.write('{}'.format(self.latest_revision))
+ with open(self.cached_revision_path, 'wb') as rev_file:
+ rev_file.write(self.latest_revision)
def load(self):
with open(self.cached_data_path, 'r') as f:
View it on GitLab:
https://salsa.debian.org/security-tracker-team/security-tracker/-/commit/140585aedf1e89c0c9ba6ce652202333131357b2
--
View it on GitLab:
https://salsa.debian.org/security-tracker-team/security-tracker/-/commit/140585aedf1e89c0c9ba6ce652202333131357b2
You're receiving this email because of your account on salsa.debian.org.
_______________________________________________
debian-security-tracker-commits mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-security-tracker-commits