mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-01 05:48:52 -06:00
refactor: read hashes and the registry one way
Hash fields go through core.hashing.parse_hash_list, which also splits comma-joined list items: the truth model compared a comma-joined sha256 list as one value. _registry.yml goes through load_platform_registry (required= where an absent file must stop the run), database.json through load_database, file and member digests through file_digest and stream_hashes. download.py and check_release read SHA256SUMS.txt with one parser: a sha256sum -b line matched nothing in download.py and the pack went unchecked.
This commit is contained in:
1 parent
7cd499531d
commit
348d5b51c3
32 files changed
+130
-217
No files matched your search
@@ -21,7 +21,7 @@ from collections.abc import Iterable
|
||||
from pathlib import Path
|
||||
|
||||
from core.artifacts import set_plain_mode
|
||||
from core.hashing import compute_hashes
|
||||
from core.hashing import compute_hashes, parse_hash_list
|
||||
from core.paths import REPO_ROOT
|
||||
|
||||
|
||||
@@ -436,6 +436,5 @@ def _matches(hashes: dict, expected_sha1: str, expected_md5: str) -> bool:
|
||||
if expected_sha1 and hashes["sha1"].lower() != expected_sha1.lower():
|
||||
return False
|
||||
if expected_md5:
|
||||
md5_list = [m.strip().lower() for m in expected_md5.split(",") if m.strip()]
|
||||
return hashes["md5"].lower() in md5_list
|
||||
return hashes["md5"].lower() in parse_hash_list(expected_md5)
|
||||
return True
|
||||
Reference in new issue
Block a user