mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-17 08:53:28 -05:00
fix: arbitrate slots for the target and source
This commit is contained in:
1 parent
1d7b6462e9
commit
479ad7fd8c
4 files changed
+29
-5
No files matched your search
@@ -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
@@ -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
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -715,6 +715,21 @@ class AnArchiveIsClaimedByItsMembers(unittest.TestCase):
|
||||
config["verification_mode"] = "md5"
|
||||
self.assertEqual(slots.find_conflicts(config, self.profiles, self.db, "system"), [])
|
||||
|
||||
def test_a_target_without_the_core_keeps_the_pin(self):
|
||||
"""DuckStation exists on no RetroArch target and still replaced the
|
||||
scph5000.bin System.dat pins in every --target pack."""
|
||||
config = self._config("existence", "short")
|
||||
self.assertTrue(slots.pack_overrides(config, self.profiles, self.db))
|
||||
self.assertEqual(
|
||||
slots.pack_overrides(config, self.profiles, self.db, target_cores={"other"}), {}
|
||||
)
|
||||
|
||||
def test_a_baseline_pack_serves_the_baseline(self):
|
||||
config = self._config("existence", "short")
|
||||
self.assertEqual(
|
||||
slots.pack_overrides(config, self.profiles, self.db, source="platform"), {}
|
||||
)
|
||||
|
||||
def test_a_pin_holding_the_members_is_agreement(self):
|
||||
config = self._config("md5", "full")
|
||||
self.assertEqual(slots.find_conflicts(config, self.profiles, self.db, "system"), [])
|
||||
|
||||
Reference in new issue
Block a user