refactor: one refusal for profile-blind narrowings

generate_pack and verify each held a copy of the refusal added for MiSTer
and BizHawk. without_profile_blind in common.py is the one both read.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 15:23:13 +01:00
1 parent 8a48156830
commit 537f814d4a
3 files changed
+49 -66

No files matched your search

+14 -22
View File
@@ -65,7 +65,7 @@ from common import (
load_database,
load_emulator_profiles,
load_platform_config,
profile_blind_platforms,
without_profile_blind,
resolve_system_arg,
print_platform_listing,
select_systems,
@@ -3020,27 +3020,19 @@ def _main(held: contextlib.ExitStack) -> None:
# generate_pack refuses these on a platform whose cores no profile
# describes, and the report answers the same request the same way.
flags = [
flag for flag, given in (
("--region", requested_regions),
("--no-game-data", getattr(args, "no_game_data", False)),
) if given
]
if flags:
blind = profile_blind_platforms(
platforms, args.platforms_dir, emu_profiles,
target_cores_cache if args.target else None,
)
for name in blind:
message = (
f"{name} runs no core a profile describes, and "
f"{', '.join(flags)} reads the profiles"
)
if not args.all:
print(f"ERROR: {message}: drop {', '.join(flags)}", file=sys.stderr)
sys.exit(1)
print(f" {message}: left out")
platforms = [name for name in platforms if name not in blind]
platforms = without_profile_blind(
platforms,
[
flag for flag, given in (
("--region", requested_regions),
("--no-game-data", getattr(args, "no_game_data", False)),
) if given
],
args.platforms_dir,
emu_profiles,
target_cores_cache if args.target else None,
args.all,
)
# Group identical platforms (same function as generate_pack)
groups = group_identical_platforms(