From: Tim Orling <ticotimo@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Tim Orling <tim.orling@konsulko.com>
Subject: [PATCH] lib/oe/distro_check: also list the Debian binary packages
Date: Sat, 14 Nov 2026 19:30:19 -0800 [thread overview]
Message-ID: <20261115033018.75976-2-tim.orling@konsulko.com> (raw)
Only the source package names were recorded from Debian style Sources
files, but Debian names Python modules' source packages after the
upstream project and their binary packages python3-<name>, as OE does,
so a recipe such as python3-brotli never matched Debian's "brotli",
which builds python3-brotli. Record the names in each Binary field too.
Tested against Debian 13.7: 91775 names instead of 37593, 5316 of them
python3-*.
[YOCTO #16512]
AI-Generated: Claude Opus 5.5
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
This applies on top of "distro_check: fix the Ubuntu and openSUSE
package lists, drop Clear":
https://lore.kernel.org/all/20261115021914.67744-1-tim.orling@konsulko.com/
meta/lib/oe/distro_check.py | 22 ++++++++++++++-----
.../oeqa/selftest/cases/oelib/distro_check.py | 18 +++++++++++++++
2 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py
index 03237804b2..c92468bb64 100644
--- a/meta/lib/oe/distro_check.py
+++ b/meta/lib/oe/distro_check.py
@@ -127,16 +127,28 @@ 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 or Sources.xz file"
+ """
+ Return the names of the source packages in a debian style Sources.gz or
+ Sources.xz file, and of the binary packages they build (e.g. Debian's
+ "brotli" builds "python3-brotli")
+ """
import gzip
import lzma
opener = lzma.open if url.endswith(".xz") else gzip.open
package_names = set()
+ field = None
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)
+ if line[:1] in (" ", "\t"):
+ # Continuation of the previous field
+ names = line if field == "Binary" else ""
+ else:
+ field, _, value = line.partition(":")
+ names = value if field in ("Package", "Binary") else ""
+ for name in names.split(","):
+ name = name.strip()
+ if name:
+ package_names.add(name + ":" + section)
return package_names
def get_latest_released_debian_source_package_list(d):
@@ -191,7 +203,7 @@ def create_distro_packages_list(distro_check_dir, d):
except Exception as e:
bb.warn("Cannot fetch packages for %s: %s" % (name, e))
continue
- bb.note("Distro: %s, Latest Release: %s, # src packages: %d" % (name, release, len(package_list)))
+ bb.note("Distro: %s, Latest Release: %s, # packages: %d" % (name, release, len(package_list)))
if len(package_list) == 0:
bb.error("Didn't fetch any packages for %s %s" % (name, release))
diff --git a/meta/lib/oeqa/selftest/cases/oelib/distro_check.py b/meta/lib/oeqa/selftest/cases/oelib/distro_check.py
index d783384251..32abba8e39 100644
--- a/meta/lib/oeqa/selftest/cases/oelib/distro_check.py
+++ b/meta/lib/oeqa/selftest/cases/oelib/distro_check.py
@@ -52,6 +52,24 @@ Version: 99.10
Supported: 0
"""
+SOURCES_WITH_BINARIES = b"""Package: brotli
+Binary: python3-brotli, brotli, libbrotli-dev,
+ libbrotli1
+Version: 1.1.0-2
+Description: an example
+ Binary: not-a-package
+
+Package: six
+Binary: python3-six
+"""
+
+class TestDebianStyleBinaryPackages(TestCase):
+ def test_binary_packages(self):
+ with mock.patch.object(oe.distro_check, "create_socket", return_value=io.BytesIO(gzip.compress(SOURCES_WITH_BINARIES))):
+ names = oe.distro_check.get_debian_style_source_package_list("http://example.com/Sources.gz", "main", None)
+ self.assertEqual(names, {"brotli:main", "python3-brotli:main", "libbrotli-dev:main", "libbrotli1:main",
+ "six:main", "python3-six:main"})
+
class TestFindLatestUbuntuRelease(TestCase):
def test_latest_supported(self):
with mock.patch.object(oe.distro_check, "create_socket", return_value=io.BytesIO(META_RELEASE)):
--
2.56.1
reply other threads:[~2026-11-15 3:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261115033018.75976-2-tim.orling@konsulko.com \
--to=ticotimo@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=tim.orling@konsulko.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox