diff mbox series

[2/3] lib/oe/distro_check: fetch Debian updates from stable-updates

Message ID 20261114200810.31078-3-tim.orling@konsulko.com
State New
Headers show
Series Fix distro_check when a distro list cannot be fetched | expand

Commit Message

Tim Orling Nov. 14, 2026, 8:08 p.m. UTC
ftp.debian.org no longer has dists/stable-proposed-updates, so the
Debian package list always failed with HTTP 404. Use stable-updates,
the equivalent of Ubuntu's -updates, which is only published as
Sources.xz, so read .xz files with lzma.

Tested against ftp.debian.org: the Debian list is fetched again, with
both main and updates packages.

[YOCTO #16503]

AI-Generated: Claude Opus 5.5
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 meta/lib/oe/distro_check.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py
index 56f81e630d..223bed2ec2 100644
--- a/meta/lib/oe/distro_check.py
+++ b/meta/lib/oe/distro_check.py
@@ -110,11 +110,13 @@  def find_latest_debian_release(url, d):
         return "_NotFound_"
 
 def get_debian_style_source_package_list(url, section, d):
-    "Return the list of package-names stored in the debian style Sources.gz file"
+    "Return the list of package-names stored in the debian style Sources.gz or Sources.xz file"
     import gzip
+    import lzma
 
+    opener = lzma.open if url.endswith(".xz") else gzip.open
     package_names = set()
-    for line in gzip.open(create_socket(url, d), mode="rt"):
+    for line in opener(create_socket(url, d), mode="rt"):
         if line.startswith("Package:"):
             pkg = line.split(":", 1)[1].strip()
             package_names.add(pkg + ":" + section)
@@ -125,7 +127,7 @@  def get_latest_released_debian_source_package_list(d):
     latest = find_latest_debian_release("http://ftp.debian.org/debian/dists/", d)
     url = "http://ftp.debian.org/debian/dists/stable/main/source/Sources.gz"
     package_names = get_debian_style_source_package_list(url, "main", d)
-    url = "http://ftp.debian.org/debian/dists/stable-proposed-updates/main/source/Sources.gz"
+    url = "http://ftp.debian.org/debian/dists/stable-updates/main/source/Sources.xz"
     package_names |= get_debian_style_source_package_list(url, "updates", d)
     return latest, package_names