mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-28 12:28:51 -06:00
refactor: move verify, slots, crossref into packs
The three commands keep their parser, main and printing. Scans, scopes, report text, the JSON forms, the strict gate and the destinations file live in new packs modules, one subject each.
This commit is contained in:
1 parent
1e95a73a4d
commit
6ba52a9682
21 files changed
+897
-774
No files matched your search
@@ -0,0 +1,35 @@
|
||||
"""What fails a verify run under --strict, and the line that says why."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from packs.verdicts import Severity, Status
|
||||
|
||||
|
||||
def platform_strict_failure(results: list[dict]) -> str | None:
|
||||
"""The failure of platform results counting a critical file: a required
|
||||
file missing where the frontend reads hashes, or None.
|
||||
|
||||
A file present whose hash the frontend does not confirm is UNTESTED, a
|
||||
warning (Batocera's BiosStatus calls it so): reported, not failed.
|
||||
"""
|
||||
critical = sum(r["severity_counts"].get(Severity.CRITICAL, 0) for r in results)
|
||||
if not critical:
|
||||
return None
|
||||
return (f"ERROR: {critical} required file(s) missing where the frontend "
|
||||
"checks hashes")
|
||||
|
||||
|
||||
def emulator_strict_failure(result: dict) -> str | None:
|
||||
"""The failure of an emulator lacking a file it cannot run without, or None.
|
||||
|
||||
The emulator, not a frontend, is the judge here: a required file with no
|
||||
HLE fallback that the collection does not hold stops the core.
|
||||
"""
|
||||
missing = sorted({
|
||||
d["name"] for d in result["details"]
|
||||
if d["status"] == Status.MISSING and d.get("required", True)
|
||||
and not d.get("hle_fallback")
|
||||
})
|
||||
if not missing:
|
||||
return None
|
||||
return f"ERROR: {len(missing)} required file(s) missing: {', '.join(missing)}"
|
||||
Reference in new issue
Block a user