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()