From c4a080b0f4b01f067cbea3cdb7252ba6ee96dc9e Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 6 Oct 2026 00:13:38 +0200 Subject: [PATCH] fix: group regions by the target in pack integrity --- scripts/packverify.py | 1 + tests/test_region.py | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/scripts/packverify.py b/scripts/packverify.py index 68e05d4a..5f2bf153 100644 --- a/scripts/packverify.py +++ b/scripts/packverify.py @@ -514,6 +514,7 @@ def verify_pack_against_platform( db, base_dest, emu_profiles, + target_cores=target_cores, ) region_drops = region_mod.resolve_region_drops( region_groups, region_index, regions diff --git a/tests/test_region.py b/tests/test_region.py index 88b24adf..db2a6e5b 100644 --- a/tests/test_region.py +++ b/tests/test_region.py @@ -584,6 +584,33 @@ class TestReportAndBuilderNarrowTogether(unittest.TestCase): self.assertIn(kept, names, "a system with no candidate in the region falls back") self.assertEqual(full["total_files"], narrowed["total_files"]) + def test_every_grouping_call_carries_the_target(self): + """Integrity grouped every core's extras while the builder grouped the target's. + + Under --target with --region, a fallback the pack kept was withdrawn + from the check: 14 Batocera rk3568 files were never verified. + """ + import ast + + scripts = Path(__file__).resolve().parent.parent / "scripts" + for path in sorted(scripts.rglob("*.py")): + tree = ast.parse(path.read_text(encoding="utf-8")) + for func in ast.walk(tree): + if not isinstance(func, (ast.FunctionDef, ast.AsyncFunctionDef)): + continue + params = {a.arg for a in func.args.args + func.args.kwonlyargs} + if "target_cores" not in params: + continue + for call in ast.walk(func): + if ( + isinstance(call, ast.Call) + and getattr(call.func, "id", None) == "platform_region_groups" + ): + with self.subTest(module=path.name, function=func.name): + self.assertIn( + "target_cores", {k.arg for k in call.keywords} + ) + if __name__ == "__main__": unittest.main()