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:
Abdessamad Derraz committed 2026-11-20 18:28:40 +01:00
1 parent 7cd499531d
commit 348d5b51c3
32 files changed
+130 -217

No files matched your search

+3 -6
View File
@@ -13,9 +13,10 @@ from pathlib import Path, PurePosixPath
import yaml
from model.registry import load_platform_registry
from model.profiles import source_yaml_paths
from model.safeparse import yaml_load
from core.paths import REPO_ROOT
from core.paths import PLATFORMS_DIR, REPO_ROOT
try:
from jsonschema import Draft202012Validator, FormatChecker
@@ -629,11 +630,7 @@ def _save_directory_blocks() -> list[str]:
folder per launched system) needs the platform file's libretro_systems,
and ``by_core_for`` names the cores a launcher sorts by core.
"""
registry_path = REPO_ROOT / "platforms" / "_registry.yml"
if not registry_path.is_file():
return []
with registry_path.open(encoding="utf-8") as handle:
platforms = (yaml_load(handle) or {}).get("platforms") or {}
platforms = load_platform_registry(REPO_ROOT / PLATFORMS_DIR)
out: list[str] = []
for name, entry in sorted(platforms.items()):
if not isinstance(entry, dict) or "save_directory" not in entry: