mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 13:33:24 -05:00
fix: let a shared path only keep a system
This commit is contained in:
1 parent
ffa6516e09
commit
2a049dc9c9
2 files changed
+27
-4
No files matched your search
+8
-4
@@ -1684,12 +1684,16 @@ def filter_systems_by_target(
|
||||
(),
|
||||
)
|
||||
}
|
||||
all_cores = norm_system_cores.get(norm_key, set()) | file_cores
|
||||
all_cores = norm_system_cores.get(norm_key, set())
|
||||
plat_cores_here = norm_plat_system_cores.get(norm_key, set())
|
||||
if platform_cores is not None:
|
||||
plat_cores_here = plat_cores_here | (file_cores & set(platform_cores))
|
||||
|
||||
if not all_cores and not plat_cores_here:
|
||||
if file_cores & expanded_target:
|
||||
# An on-target core reads the system's files. The evidence only
|
||||
# keeps: a path shared with an off-target core says nothing of the
|
||||
# other files, and Batocera's bbc runs on MAME, which no profile
|
||||
# ties to bbcb.zip, while CLK reads two of its ROMs.
|
||||
filtered[sys_id] = sys_data
|
||||
elif not all_cores and not plat_cores_here:
|
||||
# No profile maps to this system -keep it
|
||||
filtered[sys_id] = sys_data
|
||||
elif all_cores & expanded_target:
|
||||
|
||||
@@ -56,6 +56,25 @@ class TargetSystems(unittest.TestCase):
|
||||
def test_without_that_evidence_the_off_target_core_drops_it(self):
|
||||
self.assertEqual(self.kept(systems("Enterprise/exos10.bin")), [])
|
||||
|
||||
def test_a_path_an_off_target_core_reads_excludes_nothing(self):
|
||||
"""Batocera's bbc runs on MAME, which no profile ties to bbcb.zip; CLK
|
||||
reads two of its ROMs. With CLK off the target the system stayed
|
||||
unknown before and must stay kept."""
|
||||
declared = {"bbc": {"files": [
|
||||
{"name": "os12.rom", "destination": "BBCMicro/os12.rom"},
|
||||
{"name": "bbcb.zip", "destination": "bbcb.zip"},
|
||||
]}}
|
||||
profiles = dict(PROFILES)
|
||||
profiles["clk"] = dict(PROFILES["clk"], files=[
|
||||
{"name": "os12.rom", "path": "BBCMicro/os12.rom"}])
|
||||
self.assertEqual(
|
||||
sorted(filter_systems_by_target(
|
||||
declared, profiles, {"ep128emu_core"},
|
||||
platform_cores={"ep128emu_core", "clk"},
|
||||
)),
|
||||
["bbc"],
|
||||
)
|
||||
|
||||
def test_a_bare_name_is_no_evidence(self):
|
||||
declared = {"enterprise-64-128": {"files": [{"name": "bios.bin"}]}}
|
||||
self.assertEqual(
|
||||
|
||||
Reference in new issue
Block a user