From patchwork Sun Nov 15 03:18:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 104083 X-Patchwork-Delegate: ticotimo@gmail.com Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1596.1794712754518295921 for ; Sat, 14 Nov 2026 19:19:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=k3Y8RVsB; spf=pass (domain: gmail.com, ip: 209.85.210.178, mailfrom: ticotimo@gmail.com) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-8b4c8b51b58so2347859b3a.1 for ; Sat, 14 Nov 2026 19:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794712754; x=1795317554; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=TyGlmTfWInQEPXD6KY+611Vf2W/MDfrV8me1NdVX8nY=; b=k3Y8RVsB1Yr8DOCnBS7dDIqvvb4uSButKXDo/BmhikvSEhcu6UXljNr20hQu1ta4kw HdqHgS45rfF2XDxnliE33m5j1lcJLJm6BLfFEXrek31g6z15N0RUdf4LxrrjAlYSviyN dD28leVOO2O4qW4hOINkuDcrUFLpnhMR4OK/xbFCybq+pYxKHGogxAnsKFRw+oPr1uHW 8G5UXO50FC/vrelpexfcI18ZopPEx1qfFe8EGq1ajUYhpCSglh8r4M1UIcJeqLq7WDjq Of+3YfbeVEU3RRuGHtCE68GKMAD/YgKqds2d2f5Pkrn1Nb8jnrxdfu5nwpcYnTsddTCw u0Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794712754; x=1795317554; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=TyGlmTfWInQEPXD6KY+611Vf2W/MDfrV8me1NdVX8nY=; b=pIfm4x0KQxjfzADbzPPTfSb/sG/cYzX+nUygtb7an4fmjKeCyJzoo1k7Oh3OgcTDYf mMozdUoEcF1m2S3yBVk8g1wTcNeTA5OuAFO25uF/jWGdNTubDgH/QgfnnNB6ANKe7e9b 1az3ZHA/t3JbqBHpOpz7ZldpzoA/7LQHl5BmgEHHeuWDwP40fY0bQVc/McxNWBPl2n6z ryd0a7hCXJqcs3CF/qVolDMnqRMTpJBUqNntehm4gpF5e2JFoqgpQYoP+UgglU3vz9I8 G01TWhGlY80bTwf3TPgxpTGaxus+HCbg7oPIZjqhHp4ZB/mtmXKzsS1o7o/p1tKSEmao 9Hkg== X-Gm-Message-State: APuU4Z8GGQ0E9h9m2S7PxcBrCiAxjXRtp766T/kx9LkfJ4oOYCdDv7EL fPHQWE5G4NBkJJHTyAwSmVgABwsVreMnWpRU4a6bNTm9Oz7/mCREV0NyIvVVEw== X-Gm-Gg: AYBFou13KkPfv3l85Kxr3w33Lmv8G+9Y5PjjG/PhMB8gMtS90JgNwOaUsJUXHW6m82R JyCzCmf/QVM7zaB4o3jQm9gy0ru7T/6QdWm3GMZ4UpRaozIVMOEWg3mI8uz4Bcpx8eAofThud54 1ANleJaa55CaX8LTUwclR4ZJ4USTb/79AVtARVBDu8vRWU8V4M0BfrW4L5OdAp8mp4PNR8BQo2f KM7wguLDUEHdkawlCrJ9uzETrhmHNAdad0eLLKRL5IIrCTLRvJsyqdSEp43GhwIM2qmVyiGBGpb 0D2pIBTae23dyNhB66Ib9sKVMlOxWcXjHlyR9Jcb7pxwDcwv0vvFAes9XPbpZFxSg7RrvXJ/SRc rYixQIAWCtBd6V+jvAMYr6xC1EjlAWM1Xe2uZWPILpi75JofCFg6NfK7EUES0Z6lE0LNp1ipjND yUZ++W39Owkmy9ni2UOUFj9jbnXkGr9CH1chhkQVuWQfsDuTtspQE3TI+3qMbGWz7OdrV1Z4sCX zqYsbEl/BS4oyG94GEx6yWNAKWW6ulHwuzhEDHVwnLw5epn8E06CmuvIx3JSucBbNdvvY6EfV4q 2UQeTL7qrpUGebIyYwG25/Cm2mZtbueP3xX4MjCasW9lAgrPvpAs6/MKod9wyg== X-Received: by 2002:a05:6a20:6a1b:b0:3eb:8c85:92b8 with SMTP id adf61e73a8af0-3f7a74c34f2mr7575556637.19.1794712753909; Sat, 14 Nov 2026 19:19:13 -0800 (PST) Return-Path: Received: from localhost.localdomain ([69.9.132.159]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cddc1898afbsm2761560a12.19.2026.11.14.19.19.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 14 Nov 2026 19:19:12 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto-patches@lists.yoctoproject.org Cc: Tim Orling Subject: [layerindex-web][PATCH 1/2] rrs_distros: strip the native/cross suffixes before matching distro packages Date: Sat, 14 Nov 2026 19:18:04 -0800 Message-ID: <20261115031803.74076-4-tim.orling@konsulko.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261115031803.74076-2-tim.orling@konsulko.com> References: <20261115031803.74076-2-tim.orling@konsulko.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Sun, 15 Nov 2026 03:19:20 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5389 search_package_in_distros() meant to strip nativesdk-, -native, -cross and -initial from the recipe name, but discarded the result of str.replace(). Keep it. [YOCTO #16513] AI-Generated: Claude Opus 5.5 Signed-off-by: Tim Orling --- rrs/tools/rrs_distros.py | 2 +- tests/test_rrs_distros.py | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 tests/test_rrs_distros.py diff --git a/rrs/tools/rrs_distros.py b/rrs/tools/rrs_distros.py index 3dc745d..55f5aeb 100755 --- a/rrs/tools/rrs_distros.py +++ b/rrs/tools/rrs_distros.py @@ -59,7 +59,7 @@ def search_package_in_distros(pkglst_dir, recipe, data): removes = ['nativesdk-', '-native', '-cross', '-initial'] for r in removes: - recipe_name.replace(r, '') + recipe_name = recipe_name.replace(r, '') distro_alias = data.getVar('DISTRO_PN_ALIAS', True) if distro_alias: diff --git a/tests/test_rrs_distros.py b/tests/test_rrs_distros.py new file mode 100644 index 0000000..419b44d --- /dev/null +++ b/tests/test_rrs_distros.py @@ -0,0 +1,45 @@ +# layerindex-web - tests for matching recipes to distro packages in rrs/tools/rrs_distros.py +# +# Licensed under the MIT license, see COPYING.MIT for details +# +# SPDX-License-Identifier: MIT + +import os +import sys +import types + +import pytest + +sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'rrs', 'tools')) + + +@pytest.fixture +def rrs_distros(monkeypatch): + # The test settings don't install the rrs app, which the script imports + monkeypatch.setitem(sys.modules, 'rrs.models', types.SimpleNamespace(RecipeDistro=None, MaintenancePlan=None)) + monkeypatch.delitem(sys.modules, 'rrs_distros', raising=False) + import rrs_distros + return rrs_distros + + +@pytest.fixture +def pkglst_dir(tmp_path): + # Package lists as OE-Core's distro_check writes them: -, ":
" lines + (tmp_path / 'Debian-13.7').write_text('brotli:main\npython3-brotli:main\nlz4:main\nfoo:main\n') + (tmp_path / 'Fedora-45').write_text('python-brotli:main\nlz4:main\n') + return tmp_path + + +def search(rrs_distros, pkglst_dir, pn, alias=None): + recipe = types.SimpleNamespace(pn=pn) + data = types.SimpleNamespace(getVar=lambda name, expand=True: alias if name == 'DISTRO_PN_ALIAS' else None) + return rrs_distros.search_package_in_distros(str(pkglst_dir), recipe, data) + + +def test_native_suffix_is_ignored(rrs_distros, pkglst_dir): + assert search(rrs_distros, pkglst_dir, 'foo-native') == {'Debian-main': 'foo'} + + +def test_distro_pn_alias(rrs_distros, pkglst_dir): + assert search(rrs_distros, pkglst_dir, 'liblz4', alias='Debian=lz4 Fedora=lz4') == {'Debian-main': 'lz4', 'Fedora-main': 'lz4'} + From patchwork Sun Nov 15 03:18:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 104084 X-Patchwork-Delegate: ticotimo@gmail.com Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.1604.1794712791213747881 for ; Sat, 14 Nov 2026 19:19:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=w/+hR6yd; spf=pass (domain: gmail.com, ip: 209.85.215.175, mailfrom: ticotimo@gmail.com) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-cddac941ed1so1083037a12.2 for ; Sat, 14 Nov 2026 19:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794712790; x=1795317590; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9J/w84Lthu0JmHERVtF39NnbI9oDf0PfwMcFQPPamaM=; b=w/+hR6ydWpZOgn73oQl4Sn3q+d9lq9lV3u+YjK9VhgQNNTpzAxCti4eFI+sJuyBG2b IW3oOHhJNs2aIGRgRp6GHuYAoCUtae6Ef55Oye2xCsrb1Iib+miUyqD6eT+10TNSdZ27 KePZRr4Awo7istWH0f8HgCsx1j51vJSFsLW7ssGEie+beUf8pRjXj958L/aG5SmenttJ O1n+RucxE9sojPhmlo982AYYx6afzdJGSTxdMnfamJJq75f7KQwSB6cXzRiZ3TgJRz/R qKTCcg9VJ9Jnzr/FgaSYt3OlUBVCGbxh/o//ctcydDODblj9xRLNfumDSghgbTTC8jJP Mz7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794712790; x=1795317590; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=9J/w84Lthu0JmHERVtF39NnbI9oDf0PfwMcFQPPamaM=; b=1mC//7bBkZ40vVlQirLxxCK8lAFRNHzipHBKwI0EqigoxJd48/JhsYtF16e5xl6ZTn i4LoKulkrmgfLnyEni+R7pK59oL6AEZkkZ6eu+/+7OdI5PTx1c90qCgfNZH0hsClz2fu /lgzLhwOsn5ESUp26p6AUNDYUFenhm7fIqW3tza+R4Mz55ZUa3jjzQ1kkcsCwFntXiQR C6amJDoHIGYB/V4Owj8FdgMHvFIUyg8h5uJIAvcEVdvb9yRa8Sz8dz0gQ6/s2nij9a5z Olf4FEIsxjA3tXD3Haz+3ije1+tqhyRlBngg/5It7pcdkb7EdHGDJKIoIJYcqtbGY97s bGPA== X-Gm-Message-State: APuU4Z8Q0Yg/GLe7IkAOwV6wef9fOqQVBVf0Hd6rQFuR/NKkinnyXgQM Yr0HByenG8iMxn2tWQ7N3BmnUPH6PbLAt7sQqOae4YkWRwpVoI/MQx9yAAnEIw== X-Gm-Gg: AYBFou0pH1SC3/7t9sUPFFwn/TUaPc7R+lioGGB8B8f1dk+6chAdCQMG4gH3JJZ2gd9 jfBs5KK1b8JvNifdt2g4FfYGiAz0slhX8L6Ph83ij9l5hbXvbBkZIxi0baD32ZEKyYnkIP9lCFH RzUUXkhVVPJUeEQOKRGwM2XIsygVXfey0RcCWRp5hD4mw8UBS/atI2yv+E0oeTXQFRb0Yg7FrYv MkxGn4Mz/PEo3z0b37K6HEP32CHXycjeNfhHqM6KA5AUHA/4FZO9BMF7aJRnmDUARUig1hRUIow w6scuR6EnPSKeats7enWcBapZ+7+sZCSUZ9LG884H/wYu5wsR8hPXVTwNZqmL/BpzBFvoy3y62i 2bg+VfXG0j9ueyWvbXB4rGzMf2alqE9PwM8qgqs9e6OZcNhi6OmtK4xQPQqLWbU05OtJya6oUhk Q7cMOgUqy6Vsrn9z+PrgeibxT7HtizcI+PuoDj/EaPBU2SaNCcf9ucgMBpl+cJqCwnAW/e1zkYG 9kxW5ybrqp0bGkdKSyuApNcZKxKCxCTeH/mSvoSQqEkMoWVkISghWsc2ZzRbDyReIz23v029SGL 69aEZKx4wBxjeJcKQp6Ai93PMQ98zmUKb/6J2VongqtNk1m8748LtU7NH1ZHFg== X-Received: by 2002:a05:6a21:790e:b0:3de:517d:fd81 with SMTP id adf61e73a8af0-3f7a87d387amr4513723637.65.1794712790494; Sat, 14 Nov 2026 19:19:50 -0800 (PST) Return-Path: Received: from localhost.localdomain ([69.9.132.159]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cddc1898afbsm2761560a12.19.2026.11.14.19.19.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 14 Nov 2026 19:19:49 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto-patches@lists.yoctoproject.org Cc: Tim Orling Subject: [layerindex-web][PATCH 2/2] rrs_distros: match python3-* recipes to distro packages Date: Sat, 14 Nov 2026 19:18:06 -0800 Message-ID: <20261115031803.74076-6-tim.orling@konsulko.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261115031803.74076-2-tim.orling@konsulko.com> References: <20261115031803.74076-2-tim.orling@konsulko.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Sun, 15 Nov 2026 03:20:00 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5390 OE names Python modules python3-, Fedora and openSUSE name their source packages python-, and Debian and Ubuntu name the binary package python3- (which OE-Core's distro_check lists as well, bug 16512). So almost no python3-* recipe matched a distro. Also look for python-, and record the name that matched. The bare isn't tried: it gives false matches such as python3-lz4 against the lz4 C library. [YOCTO #16513] AI-Generated: Claude Opus 5.5 Signed-off-by: Tim Orling --- rrs/tools/rrs_distros.py | 13 +++++++++---- tests/test_rrs_distros.py | 10 ++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/rrs/tools/rrs_distros.py b/rrs/tools/rrs_distros.py index 55f5aeb..8fc7ffb 100755 --- a/rrs/tools/rrs_distros.py +++ b/rrs/tools/rrs_distros.py @@ -74,16 +74,21 @@ def search_package_in_distros(pkglst_dir, recipe, data): (distro, distro_release) = distro_file.split("-") if distro.lower() in distro_aliases: - pn = distro_aliases[distro.lower()] + names = [distro_aliases[distro.lower()]] else: - pn = recipe_name + names = [recipe_name] + # Fedora and openSUSE call the source package for a Python + # module python-. Debian's lists have the python3- + # binary package, which OE-Core's distro_check records too. + if recipe_name.startswith('python3-'): + names.append('python-' + recipe_name[len('python3-'):]) with open(os.path.join(pkglst_dir, distro_file), "r") as f: for line in f: (pkg, section) = line.split(":") - if pn == pkg: + if pkg in names: distro_complete = distro + "-" + section[:-1] - distros[distro_complete] = pn + distros[distro_complete] = pkg break return distros diff --git a/tests/test_rrs_distros.py b/tests/test_rrs_distros.py index 419b44d..45d1759 100644 --- a/tests/test_rrs_distros.py +++ b/tests/test_rrs_distros.py @@ -43,3 +43,13 @@ def test_native_suffix_is_ignored(rrs_distros, pkglst_dir): def test_distro_pn_alias(rrs_distros, pkglst_dir): assert search(rrs_distros, pkglst_dir, 'liblz4', alias='Debian=lz4 Fedora=lz4') == {'Debian-main': 'lz4', 'Fedora-main': 'lz4'} + +def test_python3_recipe(rrs_distros, pkglst_dir): + # [YOCTO #16513] Debian's list has the python3-brotli binary package, + # Fedora's has the python-brotli source package + assert search(rrs_distros, pkglst_dir, 'python3-brotli') == {'Debian-main': 'python3-brotli', 'Fedora-main': 'python-brotli'} + + +def test_python3_recipe_not_matched_by_bare_name(rrs_distros, pkglst_dir): + # lz4 is the C library, not the Python module + assert search(rrs_distros, pkglst_dir, 'python3-lz4') == {}