fix: key verify archive slots like the pack

This commit is contained in:
Abdessamad Derraz committed 2026-10-16 09:58:57 +02:00
1 parent c5d434e7d0
commit c488e0d75e
4 files changed
+24 -14

No files matched your search

+1 -11
View File
@@ -1261,17 +1261,6 @@ def _normalize_zip_for_pack(
def _archive_destination(
archive_name: str, archive_prefix: str, pack_structure: dict | None, standalone: bool
) -> str:
"""Where an emulator pack places one of the profile's archives."""
archive_dest = sanitize_pack_path(archive_name)
if archive_prefix:
archive_dest = f"{archive_prefix}/{archive_dest}"
prefix = (pack_structure or {}).get("standalone" if standalone else "libretro", "")
return f"{prefix}/{archive_dest}" if prefix else archive_dest
def _archive_is_optional(archive_entry: dict, archive_name: str, files: list[dict]) -> bool: def _archive_is_optional(archive_entry: dict, archive_name: str, files: list[dict]) -> bool:
"""Optional as a whole: its own entry and every member it carries. """Optional as a whole: its own entry and every member it carries.
@@ -4036,6 +4025,7 @@ def verify_and_finalize_packs(
return all_ok return all_ok
from packpaths import ( # noqa: E402,F401 from packpaths import ( # noqa: E402,F401
_archive_destination,
_path_parents, _path_parents,
_has_path_conflict, _has_path_conflict,
_register_path, _register_path,
+11
View File
@@ -62,3 +62,14 @@ def _resolve_destination(
rel = f"{prefix}/{rel}" rel = f"{prefix}/{rel}"
return rel return rel
def _archive_destination(
archive_name: str, archive_prefix: str, pack_structure: dict | None, standalone: bool
) -> str:
"""Where an emulator pack places one of the profile's archives."""
archive_dest = sanitize_pack_path(archive_name)
if archive_prefix:
archive_dest = f"{archive_prefix}/{archive_dest}"
prefix = (pack_structure or {}).get("standalone" if standalone else "libretro", "")
return f"{prefix}/{archive_dest}" if prefix else archive_dest
+7 -2
View File
@@ -1420,7 +1420,7 @@ def verify_emulator(
A region priority list narrows the report the same way a pack built with the A region priority list narrows the report the same way a pack built with the
same list would be narrowed, through the emulator pack's own drop set. same list would be narrowed, through the emulator pack's own drop set.
""" """
from packpaths import _resolve_destination from packpaths import _archive_destination, _resolve_destination
load_emulator_profiles(emulators_dir) load_emulator_profiles(emulators_dir)
zip_contents = build_zip_contents_index(db) zip_contents = build_zip_contents_index(db)
@@ -1543,7 +1543,12 @@ def verify_emulator(
result["hle_fallback"] = False result["hle_fallback"] = False
result["ground_truth"] = build_ground_truth(archive, validation_index) result["ground_truth"] = build_ground_truth(archive, validation_index)
details.append(result) details.append(result)
dest = archive # Where the pack puts it: an archive_prefix or pack_structure
# moves it, and a loose same-named entry is another file.
dest = _archive_destination(
archive, profile.get("archive_prefix", ""),
profile.get("pack_structure"), standalone,
)
dest_to_name[dest] = archive dest_to_name[dest] = archive
cur = result["status"] cur = result["status"]
prev = file_status.get(dest) prev = file_status.get(dest)
+5 -1
View File
@@ -18,7 +18,11 @@ from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parent.parent REPO_ROOT = Path(__file__).resolve().parent.parent
CASES = ("raze", "rust_dos", "hatari", "xash3d_fwgs", "catacombgl", "openjk", "sonic2013") # kronos: an archive unit under its archive_prefix and a loose same-named file.
CASES = (
"raze", "rust_dos", "hatari", "xash3d_fwgs", "catacombgl", "openjk", "sonic2013",
"kronos",
)
def _count(text: str, word: str) -> int: def _count(text: str, word: str) -> int: