fix: arbitrate slots for the target and source

This commit is contained in:
Abdessamad Derraz committed 2026-10-16 22:07:48 +02:00
1 parent 1d7b6462e9
commit 479ad7fd8c
4 files changed
+29 -5

No files matched your search

+4 -2
View File
@@ -610,7 +610,8 @@ def generate_pack(
validation_index = _build_validation_index(platform_profiles)
validation_owners = destination_owners(platform_profiles)
slot_overrides = slots.pack_overrides(
config, emu_profiles or {}, db, zip_contents, data_registry
config, emu_profiles or {}, db, zip_contents, data_registry,
target_cores=target_cores, source=source,
)
# Filter systems by target if specified
@@ -3437,7 +3438,8 @@ def generate_manifest(
if data_registry is None:
data_registry = load_data_dir_registry(platforms_dir)
slot_overrides = slots.pack_overrides(
config, emu_profiles, db, zip_contents, data_registry
config, emu_profiles, db, zip_contents, data_registry,
target_cores=target_cores, source=source,
)
def manifest_destination(full_destination: str) -> str:
+8 -2
View File
@@ -416,6 +416,8 @@ def pack_overrides(
db: dict,
zip_contents: dict | None = None,
data_dir_registry: dict | None = None,
target_cores: set[str] | None = None,
source: str = "full",
) -> dict[str, str]:
"""Full pack destination -> the file a platform pack serves there instead.
@@ -428,10 +430,14 @@ def pack_overrides(
"""
from common import resolve_platform_cores
if not profiles:
# A baseline-only pack serves what the platform declares, and a target's
# pack answers to the cores that hardware builds: DuckStation does not
# exist on any RetroArch target and still replaced its scph5000.bin.
if not profiles or source == "platform":
return {}
platform_profiles = {
name: profiles[name] for name in resolve_platform_cores(config, profiles)
name: profiles[name]
for name in resolve_platform_cores(config, profiles, target_cores=target_cores)
}
mode = config.get("verification_mode", "existence")
overrides: dict[str, str] = {}
+2 -1
View File
@@ -912,7 +912,8 @@ def verify_platform(
slot_overrides = {
(key[len(base_dest) + 1:] if base_dest and key.startswith(f"{base_dest}/") else key): path
for key, path in slots.pack_overrides(
config, emu_profiles or {}, db, zip_contents, data_dir_registry
config, emu_profiles or {}, db, zip_contents, data_dir_registry,
target_cores=target_cores,
).items()
}