From 040ea9f217c70f7f85cb9d2be0b451d8d47b8822 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 18 Mar 2026 06:13:22 +0100 Subject: [PATCH] fix: resolve_file skips MD5 lookup for zipped_file entries Same guard as verify.py: when zipped_file is set, the md5 is for the inner ROM, not the container ZIP. Direct MD5 lookup resolved to the standalone ROM file instead of the ZIP parent. Fixes: ep64.zip/ep128.zip (Enterprise) written as raw ROM data instead of ZIP archives in Batocera pack. Also fixes any other zipped_file entry where the inner ROM MD5 matched a standalone file in the database. Also: update Dinothawr.zip SHA1 in retroarch.yml to match actual file. --- platforms/retroarch.yml | 5 ++--- scripts/generate_pack.py | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/platforms/retroarch.yml b/platforms/retroarch.yml index 2f4f70f9..a1711547 100644 --- a/platforms/retroarch.yml +++ b/platforms/retroarch.yml @@ -458,9 +458,8 @@ systems: - name: Dinothawr.zip destination: Dinothawr.zip required: true - sha1: 693d8bb4d992c645e6413a57195acf4eca2f5a2e - md5: a2e891e330d146c4046c2b622fc31462 - crc32: 683ed4ad + sha1: eadb966430454b40a17387acc7302ff1683cc9f2 + md5: b8e3f8e88dc8164f8b4b60aa2add9107 size: 5763199 dos: files: diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index bc056574..cf638549 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -121,7 +121,9 @@ def resolve_file(file_entry: dict, db: dict, bios_dir: str, if os.path.exists(local_path): return local_path, "exact" - if md5: + # Skip MD5 direct lookup for zipped_file entries: the md5 is for the inner ROM, + # not the container ZIP. Matching it would resolve to the standalone ROM file. + if md5 and not zipped_file: sha1_from_md5 = db.get("indexes", {}).get("by_md5", {}).get(md5) if sha1_from_md5 and sha1_from_md5 in db["files"]: local_path = db["files"][sha1_from_md5]["path"]