mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 01:53:56 -06:00
fix: skip other casings in a foreign tree
reminiscence's Flashback module reunion resolved to skyline's zoneinfo/Indian/Reunion through the case-insensitive name step, and the emulator pack shipped the time-zone file. Another casing found only in another emulator's tree says nothing about the entry.
This commit is contained in:
1 parent
d38cd58036
commit
08cf4dd914
2 files changed
+15
No files matched your search
@@ -1564,11 +1564,16 @@ def resolve_local_file(
|
||||
# runs when no casing matches exactly, or when only another
|
||||
# emulator's tree does: xm6typeg got XM6 Utility's synthesized
|
||||
# SCSIINROM.DAT while the X68000 dump sat as scsiinrom.dat.
|
||||
# Another casing in another emulator's tree proves nothing:
|
||||
# reminiscence's music module reunion took skyline's
|
||||
# zoneinfo/Indian/Reunion.
|
||||
folded = _casefold_name_index(by_name)
|
||||
for try_name in names_to_try:
|
||||
for match_sha1 in folded.get(try_name.casefold(), []):
|
||||
if match_sha1 in files_db and _size_ok(match_sha1):
|
||||
path = files_db[match_sha1]["path"]
|
||||
if _foreign_tree(path, owners):
|
||||
continue
|
||||
if os.path.exists(path) and path not in candidates:
|
||||
candidates.append(path)
|
||||
if candidates:
|
||||
|
||||
@@ -93,6 +93,16 @@ class ForeignTreeNames(unittest.TestCase):
|
||||
self.assertEqual(status, "data_dir")
|
||||
self.assertEqual(Path(path).read_bytes(), b"B" * 64)
|
||||
|
||||
def test_another_casing_in_another_tree_is_not_the_file(self):
|
||||
"""reminiscence's music module reunion took skyline's
|
||||
zoneinfo/Indian/Reunion, a time-zone file, on the casefold step."""
|
||||
self._hold("bios/Other/skyline/tzdata/zoneinfo/Indian/Reunion", b"T" * 64)
|
||||
entry = {
|
||||
"name": "reunion", "aliases": ["mod.flashback-reunion"],
|
||||
"category": "game_data", "source_profile": "reminiscence",
|
||||
}
|
||||
self.assertEqual(resolve_local_file(entry, self.db), (None, "not_found"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user