From 08cf4dd91417325073d39a3ffd53f11def7e0078 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:42:29 +0100 Subject: [PATCH] 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. --- scripts/common.py | 5 +++++ tests/test_foreign_tree_names.py | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/scripts/common.py b/scripts/common.py index 231e835d6..9984ef8f6 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -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: diff --git a/tests/test_foreign_tree_names.py b/tests/test_foreign_tree_names.py index 2a24e8780..3c1866ad5 100644 --- a/tests/test_foreign_tree_names.py +++ b/tests/test_foreign_tree_names.py @@ -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()