mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-10 21:43:23 -05:00
fix: let the constrained declaration win in manifests too
A destination can be declared by more than one system, bare in one and hash-constrained in another. generate_pack resolves that with _preferred_entries so the constrained sibling claims the destination; generate_manifest never did, and named whatever answered to the name. RetroDECK's bios/d2fdc.zip is the case: declared with an md5 in the arcade system and bare under apple-ii. The pack carried the right archive, 262 bytes reached through the MAME clone map, while the manifest sent install.py to a 256-byte Apple II ROM. Downloading the ZIP and running the installer gave different files. A test now hashes every manifest entry a platform pins and compares it against what the platform declares: 3295 entries, on the platforms whose frontend reads the bytes. It accepts any of several declarations for one destination, the member-composite MD5 Recalbox pins for arcade archives, and Batocera's 29-character prefixes. Reinstating the old manifest entry fails it.
This commit is contained in:
1 parent
3a266be7a5
commit
232ef1a6b8
7 files changed
+359
-156
No files matched your search
@@ -635,9 +635,11 @@ def generate_pack(
|
||||
|
||||
preferred_entries: dict[str, int] = {}
|
||||
if source != "truth":
|
||||
# A manifest lists the full set and carries no data directories, so
|
||||
# the preference is resolved with neither narrowing nor a cache.
|
||||
preferred_entries = _preferred_entries(
|
||||
pack_systems, db, bios_dir, base_dest, required_only,
|
||||
zip_contents, data_registry, offline,
|
||||
pack_systems, db, bios_dir, base_dest, False,
|
||||
zip_contents, None, offline,
|
||||
)
|
||||
|
||||
# Region selection is decided once, over both the platform baseline and the
|
||||
@@ -2830,6 +2832,17 @@ def generate_manifest(
|
||||
|
||||
# Phase 1: baseline files
|
||||
if source != "truth":
|
||||
# The same destination can be declared by more than one system, bare
|
||||
# in one and hash-constrained in another. The builder lets the
|
||||
# constrained sibling claim it; without the same rule here the
|
||||
# manifest named whatever answered to the name, so the pack and the
|
||||
# installer disagreed about which file a destination means.
|
||||
# A manifest lists the full set and carries no data directories, so
|
||||
# the preference is resolved with neither narrowing nor a cache.
|
||||
preferred_entries = _preferred_entries(
|
||||
pack_systems, db, bios_dir, base_dest, False,
|
||||
zip_contents, None, offline,
|
||||
)
|
||||
for sys_id, system in sorted(pack_systems.items()):
|
||||
for file_entry in system.get("files", []):
|
||||
dest = sanitize_pack_path(file_entry.get("destination", file_entry["name"]))
|
||||
@@ -2839,6 +2852,10 @@ def generate_manifest(
|
||||
continue
|
||||
full_dest = f"{base_dest}/{dest}" if base_dest else dest
|
||||
|
||||
preferred = preferred_entries.get(full_dest)
|
||||
if preferred is not None and id(file_entry) != preferred:
|
||||
continue
|
||||
|
||||
dedup_key = full_dest
|
||||
if dedup_key in seen_destinations:
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user