mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-23 20:29:06 -05:00
fix: resolve a loose archive entry by its members
gngeopi and neo-emu declare neogeo.zip loose and, apart, the ROMs they open inside it. The archive pass took the copy holding them, the loose entry resolved by name to another copy, and both verify --emulator and the emulator pack reported the archive missing while the ZIP held it. with_archive_members() gives the loose entry the members in verify, the pack, slots and the gap report.
This commit is contained in:
1 parent
348c56e94c
commit
fb639647e6
5 files changed
+87
-4
No files matched your search
@@ -13,6 +13,7 @@ from collections.abc import Callable, Iterator, Mapping
|
||||
|
||||
from common import (
|
||||
adler32_of,
|
||||
archive_members,
|
||||
compute_hashes,
|
||||
name_match_size_ok,
|
||||
sanitize_pack_path,
|
||||
@@ -512,6 +513,20 @@ def declaration_settles(
|
||||
return False
|
||||
|
||||
|
||||
def with_archive_members(entry: dict, files: list[dict]) -> dict:
|
||||
"""A loose entry resolved as the archive its profile reads members from.
|
||||
|
||||
gngeopi declares neogeo.zip and, apart, the ROMs it opens inside it. The
|
||||
members decide which same-named copy is the archive: resolved by name
|
||||
alone, the loose entry took another copy than the archive pass and the
|
||||
profile blocked its own archive.
|
||||
"""
|
||||
if entry.get("archive"):
|
||||
return entry
|
||||
members = archive_members(entry.get("name", ""), files)
|
||||
return {**entry, "members": members} if members else entry
|
||||
|
||||
|
||||
def opens_by_name(file_entry: dict, profile: dict, standalone: bool = False) -> bool:
|
||||
"""Whether the code opens this entry by its name.
|
||||
|
||||
|
||||
Reference in new issue
Block a user