Merge ~litios/ubuntu-cve-tracker:bug/pkg-cache-ppas into ubuntu-cve-tracker:master

Proposed by David Fernandez Gonzalez
Status: Merged
Approved by: Eduardo Barretto
Approved revision: e489bc7dc05145c0c4423d58db8d02d911bfd2e1
Merge reported by: David Fernandez Gonzalez
Merged at revision: e489bc7dc05145c0c4423d58db8d02d911bfd2e1
Proposed branch: ~litios/ubuntu-cve-tracker:bug/pkg-cache-ppas
Merge into: ubuntu-cve-tracker:master
Diff against target: 30 lines (+5/-1)
1 file modified
scripts/generate_pkg_cache.py (+5/-1)
Reviewer Review Type Date Requested Status
Eduardo Barretto Approve
Review via email: mp+467032@code.launchpad.net

Description of the change

There is a bug when updating the cache for PPAs after the first time since all updates are marked with the Release pocket there, and we are not including in for future syncs.

Example with the change:
DEBUG: Reading esm-apps_xenial-pkg-cache.json
DEBUG: UPDATING CACHE
DEBUG: Retrieving Launchpad publications since 2024-05-22 15:40:39.232662+00:00
DEBUG: atril, 1.12.2-1ubuntu0.3+esm1, Release, 2024-06-05 20:27:52.246413+00:00, Published
DEBUG: ffmpeg, 7:2.8.17-0ubuntu0.1+esm7, Release, 2024-05-30 12:59:35.892208+00:00, Published
DEBUG: vlc, 2.2.2-5ubuntu0.16.04.5+esm3, Release, 2024-05-22 16:40:39.232662+00:00, Published
DEBUG: Retrieving Launchpad publications since 2024-05-22 15:40:39.232662+00:00
DEBUG: NEW DATE: 1717619272.246413
DEBUG: WRITING TO CACHE
DEBUG: esm-apps_xenial, esm-apps/xenial

To post a comment you must log in.
Revision history for this message
Eduardo Barretto (ebarretto) wrote :

lgtm, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/generate_pkg_cache.py b/scripts/generate_pkg_cache.py
2index a858100..250145e 100644
3--- a/scripts/generate_pkg_cache.py
4+++ b/scripts/generate_pkg_cache.py
5@@ -26,6 +26,7 @@ is_debug = False
6 pockets = []
7
8 def load_cache_file(cache_dir, release):
9+ parent = release_parent(release)
10 rel = release.replace('/', '_')
11 filename = f"{rel}-pkg-cache.json"
12 cache = {}
13@@ -35,6 +36,9 @@ def load_cache_file(cache_dir, release):
14 debug(f"Reading {filename}")
15 pockets.append("Security")
16 pockets.append("Updates")
17+ if parent:
18+ # In PPAs, security updates are marked with Release pocket.
19+ pockets.append("Release")
20 except OSError:
21 debug(f"File {filename} not found!")
22 debug(f"Creating {filename}")
23@@ -63,7 +67,7 @@ def get_binaries_rel(release, archive, real_threshold, series, cache, latest_dat
24 if s.pocket not in pockets:
25 continue
26
27- debug(f"{s.source_package_name}, {s.date_created}, {s.status}")
28+ debug(f"{s.source_package_name}, {s.source_package_version}, {s.pocket}, {s.date_created}, {s.status}")
29 if latest_date_created is None or s.date_created > latest_date_created:
30 latest_date_created = s.date_created
31

Subscribers

People subscribed via source and target branches