mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-27 03: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
@@ -61,6 +61,7 @@ from concurrent.futures import FIRST_COMPLETED, ThreadPoolExecutor, wait
|
||||
from dataclasses import dataclass
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
from model.registry import load_platform_registry
|
||||
from core.paths import REPO_ROOT
|
||||
|
||||
LOG_DIR = REPO_ROOT / "tmp" / "refresh_stale"
|
||||
@@ -99,15 +100,8 @@ class JobResult:
|
||||
|
||||
|
||||
def _load_platform_registry() -> dict[str, dict]:
|
||||
"""Return the platforms map from _registry.yml.
|
||||
|
||||
pyyaml is already a project dependency, and the registry is small so we read
|
||||
it once at startup rather than parsing each dispatch.
|
||||
"""
|
||||
import yaml
|
||||
|
||||
with PLATFORMS_REGISTRY.open(encoding="utf-8") as fh:
|
||||
return (yaml.safe_load(fh) or {}).get("platforms") or {}
|
||||
"""Return the platforms map from _registry.yml, read once at startup."""
|
||||
return load_platform_registry(PLATFORMS_REGISTRY.parent, required=True)
|
||||
|
||||
|
||||
def _platform_parents(registry: dict[str, dict]) -> dict[str, str]:
|
||||
|
||||
Reference in new issue
Block a user