mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-25 10:58:52 -06:00
fix: site reads core file counts from verify
compute_coverage recounted the gap entries: one per entry, not one per pack path, with held-but-unplaced and bundled files counted missing. RetroArch read 7956 packed and 419 missing where verify says 7977 and 66. packs/shares.py holds the split both now read.
This commit is contained in:
1 parent
d1b0c77039
commit
2f9cfc8e8d
12 files changed
+168
-94
No files matched your search
+9
-66
@@ -5,6 +5,7 @@ from __future__ import annotations
|
||||
from collections import Counter
|
||||
|
||||
from core.text import count_text
|
||||
from packs.shares import core_shares
|
||||
from packs.verdicts import Severity, Status
|
||||
from resolve.categories import BIOS
|
||||
from resolve.nativemode import reads_file_contents
|
||||
@@ -229,53 +230,6 @@ def _print_undeclared_entry(
|
||||
print(f" validates {'+'.join(checks)}")
|
||||
|
||||
|
||||
def split_undeclared(undeclared: list[dict]) -> tuple[list[dict], list[dict], list[dict]]:
|
||||
"""Game data, firmware the pack places, firmware it holds but cannot place.
|
||||
|
||||
Everything that is not game data is firmware the core loads, archives
|
||||
included: a bios_zip sat in neither list, so a required one that was
|
||||
missing was never printed.
|
||||
"""
|
||||
game_data = [u for u in undeclared if u.get("category", "bios") == "game_data"]
|
||||
firmware = [u for u in undeclared if u.get("category", "bios") != "game_data"]
|
||||
unplaced = [u for u in firmware if u["in_repo"] and not u.get("in_pack", True)]
|
||||
placed = [u for u in firmware if u.get("in_pack", True)]
|
||||
return game_data, placed, unplaced
|
||||
|
||||
|
||||
def pack_shares(result: dict) -> tuple[int, int]:
|
||||
"""The core files and the game data a platform's pack carries, by the report.
|
||||
|
||||
The builder's count, one file per pack path, when the platform pass
|
||||
replayed it. Counting entries said 1130 for RetroArch, 48 more than the
|
||||
pack holds: rom.key alone was claimed by three Amiga cores.
|
||||
"""
|
||||
packed = result.get("packed_extras")
|
||||
if packed is not None:
|
||||
return packed["bios"], packed["game_data"]
|
||||
game_data, bios_files, _unplaced = split_undeclared(result.get("undeclared_files", []))
|
||||
return (
|
||||
sum(1 for u in bios_files if u["in_repo"]),
|
||||
sum(1 for u in game_data if u["in_repo"] and u.get("in_pack", True)),
|
||||
)
|
||||
|
||||
|
||||
def core_required_missing(bios_files: list[dict]) -> list[dict]:
|
||||
"""Core files a core cannot run without, absent from the collection.
|
||||
|
||||
A file bundled with the emulator (DaedalusX64's n64.psh, the shader
|
||||
library its renderer installs beside the binary) arrives with it: the
|
||||
collection does not hold it by design, and listing it as missing sent
|
||||
readers after a file every install already has.
|
||||
"""
|
||||
return [
|
||||
u
|
||||
for u in bios_files
|
||||
if u["required"] and not u["in_repo"] and not u.get("hle_fallback")
|
||||
and not u.get("bundled")
|
||||
]
|
||||
|
||||
|
||||
def _repeated_names(entries: list[dict]) -> frozenset[str]:
|
||||
"""Names more than one of ``entries`` carries."""
|
||||
counts = Counter(u["name"] for u in entries)
|
||||
@@ -305,23 +259,12 @@ def _print_undeclared_section(result: dict, verbose: bool) -> None:
|
||||
if not undeclared and not (packed and any(packed.values())):
|
||||
return
|
||||
|
||||
game_data, bios_files, unplaced = split_undeclared(undeclared)
|
||||
|
||||
# A file installed with its emulator is never collected, firmware or
|
||||
# game data, required or not: cross_reference counts it apart. The
|
||||
# firmware already left the pack lists (_mark_unplaced), the game data
|
||||
# did not, and Abuse's three bundled data files read as missing.
|
||||
bundled = [u for u in undeclared if not u["in_repo"] and u.get("bundled")]
|
||||
game_data = [u for u in game_data if u["in_repo"] or not u.get("bundled")]
|
||||
|
||||
req_not_in_repo = core_required_missing(bios_files)
|
||||
req_hle_not_in_repo = [
|
||||
u
|
||||
for u in bios_files
|
||||
if u["required"] and not u["in_repo"] and u.get("hle_fallback")
|
||||
]
|
||||
opt_not_in_repo = [u for u in bios_files if not u["required"] and not u["in_repo"]]
|
||||
core_in_pack, gd_packed = pack_shares(result)
|
||||
shares = core_shares(result)
|
||||
bundled, unplaced, game_data = shares.bundled, shares.unplaced, shares.game_data
|
||||
req_not_in_repo = shares.required_missing
|
||||
req_hle_not_in_repo = shares.hle_missing
|
||||
opt_not_in_repo = shares.optional_missing
|
||||
core_in_pack, gd_packed = shares.in_pack, shares.game_data_packed
|
||||
core_missing_req = len(req_not_in_repo) + len(req_hle_not_in_repo)
|
||||
core_missing_opt = len(opt_not_in_repo)
|
||||
|
||||
@@ -363,8 +306,8 @@ def _print_undeclared_section(result: dict, verbose: bool) -> None:
|
||||
f"({_omission_reasons(unplaced)})")
|
||||
|
||||
if game_data or (packed and packed.get("game_data")):
|
||||
gd_missing = [u for u in game_data if not u["in_repo"]]
|
||||
gd_unplaced = [u for u in game_data if u["in_repo"] and not u.get("in_pack", True)]
|
||||
gd_missing = shares.game_data_missing
|
||||
gd_unplaced = shares.game_data_unplaced
|
||||
if gd_missing or gd_packed or gd_unplaced:
|
||||
listed = "" if verbose or not gd_missing else " (--verbose lists them)"
|
||||
print(f" Game data: {gd_packed} in pack, {len(gd_missing)} missing{listed}")
|
||||
|
||||
Reference in new issue
Block a user