From 6f82b5520df8302dbb0a77b767e17e5602417fde Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 19 Mar 2026 08:30:03 +0100 Subject: [PATCH] fix: zipped_file hash_mismatch handling in pack generation resolve_local_file returns hash_mismatch for zipped_file entries because container MD5 differs from inner ROM MD5. This is expected. Reverted the flawed deferral approach in common.py that resolved to wrong ZIPs via zip_contents flat index (electron64.zip instead of bbcb.zip when inner ROMs share the same MD5). Fixed generate_pack.py to verify inner ZIP content via check_inside_zip before marking as untested, matching verify.py behavior. pc6001/bbcb/fm7 ZIPs now correctly verified. verify.py: 679/680 Batocera (1 untested: sc3000 true mismatch) generate_pack.py: 359/359 Batocera (0 untested) --- scripts/generate_pack.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index 0f3d421d..53ff9873 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -348,7 +348,17 @@ def generate_pack( if status == "hash_mismatch": if verification_mode != "existence": - untested_files.append(file_entry["name"]) + # For zipped_file entries, hash_mismatch is expected + # (container MD5 ≠ inner ROM MD5). Verify inner content. + zf_name = file_entry.get("zipped_file") + if zf_name and local_path: + from verify import check_inside_zip + inner_md5 = file_entry.get("md5", "") + result = check_inside_zip(local_path, zf_name, inner_md5) + if result != "ok": + untested_files.append(file_entry["name"]) + else: + untested_files.append(file_entry["name"]) extract = file_entry.get("extract", False) if extract and local_path.endswith(".zip"):