diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index 74de145a..d5b7f94b 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -3298,6 +3298,8 @@ def main(): args.regions = region_mod.parse_requested(args.region) except ValueError as exc: parser.error(str(exc)) + if args.manifest_targets: + parser.error("--region is incompatible with --manifest-targets") # Quick-exit modes: --verify-packs alone = verify existing packs only # Combined with --all-variants, generation runs first then verify @@ -4543,6 +4545,16 @@ def verify_pack_against_platform( ) +def _narrows_contents(pack_name: str) -> bool: + """True when a pack holds fewer files than the platform declares. + + A source-restricted or required-only build is narrower by design, so the + full platform expectation does not apply to it and conformance is skipped. + Region is not listed: the region filter is passed to the check itself. + """ + return any(tag in pack_name for tag in ("_Platform_", "_Truth_", "_Required")) + + def verify_and_finalize_packs( output_dir: str, db: dict, @@ -4595,8 +4607,7 @@ def verify_and_finalize_packs( # Skipped for filtered/split/custom packs (intentionally partial) if skip_conformance: continue - # Skip conformance for non-full source variants - if "_Platform_" in name or "_Truth_" in name: + if _narrows_contents(name): continue platforms = pack_to_platform.get(name, []) for pname in platforms: diff --git a/tests/test_e2e.py b/tests/test_e2e.py index ca2916c4..291f8df3 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -5659,6 +5659,24 @@ struct BurnDriver BurnDrvneogeo = { ) self.assertTrue(checked.issubset(self._names_in(out))) + def test_narrowed_variants_skip_conformance(self): + from generate_pack import _narrows_contents + + for narrowed in ( + "EmuDeck_2.3.8_Required_BIOS_Pack.zip", + "EmuDeck_2.3.8_Platform_BIOS_Pack.zip", + "EmuDeck_2.3.8_Truth_Required_BIOS_Pack.zip", + "EmuDeck_2.3.8_NorthAmerica_Required_BIOS_Pack.zip", + ): + self.assertTrue(_narrows_contents(narrowed), narrowed) + + for full in ( + "EmuDeck_2.3.8_BIOS_Pack.zip", + "EmuDeck_2.3.8_NorthAmerica_BIOS_Pack.zip", + "RetroArch_v1.22.2_Switch_BIOS_Pack.zip", + ): + self.assertFalse(_narrows_contents(full), full) + def test_target_tag_formats_hardware_names(self): from generate_pack import _target_tag