fix: refuse profile narrowings without cores

MiSTer and BizHawk declare cores: []. --region, --one-per-slot and
--no-game-data read the profiles of the cores a platform runs, so their
packs and manifests withdrew nothing under a name and README that said
they had. generate_pack and verify now refuse the flags for a named
platform and leave it out under --all.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 15:01:58 +01:00
1 parent 13a10da993
commit 6bf62d5746
6 files changed
+123 -1

No files matched your search

+23
View File
@@ -2761,6 +2761,29 @@ def preferred_profile(index: dict[str, set[str]], name: str) -> str | None:
return name if name in claimants else sorted(claimants)[0]
def profile_blind_platforms(
platforms: list[str],
platforms_dir: str,
profiles: dict[str, dict],
target_cores: dict[str, set[str] | None] | None = None,
) -> list[str]:
"""Platforms that run no core a profile describes.
Regions, search order and game data are read from the profiles of the
cores a platform runs. MiSTer and BizHawk declare `cores: []`: a
--region, --one-per-slot or --no-game-data pack of theirs withdrew
nothing while its name and README said it had.
"""
return [
name for name in platforms
if not resolve_platform_cores(
load_platform_config(name, platforms_dir),
profiles,
target_cores=(target_cores or {}).get(name),
)
]
def resolve_platform_cores(
config: dict,
profiles: dict[str, dict],