mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 10:03:49 -06:00
fix: detect ROCKNIX by the OS_NAME it writes
This commit is contained in:
1 parent
d430d361d9
commit
c63a7e45b1
8 files changed
+26
-13
No files matched your search
@@ -959,7 +959,7 @@ class DetectionFollowsTheRegistry(unittest.TestCase):
|
||||
for name, entry in registry["platforms"].items():
|
||||
for rule in (entry.get("install") or {}).get("detect", []):
|
||||
if rule["method"] == "os_release":
|
||||
rules.add((name, "os_release", (rule["id"],), rule["bios_path"]))
|
||||
rules.add((name, "os_release", tuple(rule["match"]), rule["bios_path"]))
|
||||
elif rule["method"] == "file_exists":
|
||||
files = rule["file"] if isinstance(rule["file"], list) else [rule["file"]]
|
||||
rules.add((name, "file_exists", tuple(files), rule["bios_path"]))
|
||||
@@ -972,7 +972,9 @@ class DetectionFollowsTheRegistry(unittest.TestCase):
|
||||
lambda p: str(p) in ("/etc/knulli-release", "/etc/batocera-version"),
|
||||
):
|
||||
self.assertEqual(install._detect_embedded(), [("batocera", Path("/userdata/bios"))])
|
||||
with unittest.mock.patch.object(install, "_parse_os_release", return_value={"ID": "ROCKNIX"}):
|
||||
# What ROCKNIX writes since 2025: OS_NAME and HW_DEVICE, no ID.
|
||||
with unittest.mock.patch.object(install, "_parse_os_release",
|
||||
return_value={"OS_NAME": "ROCKNIX", "HW_DEVICE": "RK3566"}):
|
||||
self.assertEqual(
|
||||
install._detect_embedded(), [("rocknix", Path("/storage/roms/bios"))]
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user