diff --git a/platforms/_registry.yml b/platforms/_registry.yml index 970a060e..e2a8c722 100644 --- a/platforms/_registry.yml +++ b/platforms/_registry.yml @@ -625,6 +625,8 @@ platforms: source_url: https://raw.githubusercontent.com/RetroBat-Official/emulatorlauncher/master/batocera-systems/Resources/batocera-systems.json source_format: json hash_type: md5 + # Windows: names differing only by case land on one file. + case_insensitive_fs: true schedule: weekly cores: - '81' @@ -812,6 +814,8 @@ platforms: source_wiki: https://raw.githubusercontent.com/EmuDeck/emudeck.github.io/main/docs/tables/ source_format: bash_script+csv hash_type: md5 + # Windows: names differing only by case land on one file. + case_insensitive_fs: true schedule: weekly target_scraper: emudeck_targets target_source: https://github.com/dragoonDorise/EmuDeck @@ -976,6 +980,8 @@ platforms: source_url: https://raw.githubusercontent.com/TASEmulators/BizHawk/master/src/BizHawk.Emulation.Common/Database/FirmwareDatabase.cs source_format: csharp_firmware_database hash_type: sha1 + # Windows: names differing only by case land on one file. + case_insensitive_fs: true schedule: monthly cores: - applewin diff --git a/tests/test_case_insensitive_platforms.py b/tests/test_case_insensitive_platforms.py new file mode 100644 index 00000000..575aac27 --- /dev/null +++ b/tests/test_case_insensitive_platforms.py @@ -0,0 +1,34 @@ +"""A platform the installer targets on Windows or macOS packs case-insensitively. + +RetroBat shipped quasi88/N88.ROM (the md5 it pins) beside quasi88/n88.rom; +extracted on NTFS the second overwrote the first and RetroBat's own check +went red. The flag lived in retrobat.yml and vanished at the next scrape. +""" + +from __future__ import annotations + +import sys +import unittest +from pathlib import Path + +import yaml + +REPO_ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(REPO_ROOT / "scripts")) + + +class CaseInsensitiveWhereTheFilesystemIs(unittest.TestCase): + def test_windows_and_macos_platforms_carry_the_flag(self): + from common import load_platform_config + + registry = yaml.safe_load((REPO_ROOT / "platforms" / "_registry.yml").read_text()) + for name, data in registry["platforms"].items(): + systems = {str(d.get("os")) for d in (data.get("install") or {}).get("detect", [])} + if systems & {"windows", "darwin"}: + with self.subTest(platform=name): + config = load_platform_config(name, str(REPO_ROOT / "platforms")) + self.assertTrue(config.get("case_insensitive_fs")) + + +if __name__ == "__main__": + unittest.main()