From 8a9dea91c2b2a341e1996ac40a6fb27e12246353 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 19 Mar 2026 08:43:07 +0100 Subject: [PATCH] fix: verify and pack report consistent untested counts generate_pack.py skipped duplicate destination entries before running verification, hiding untested files that verify.py caught. Now all entries are verified even when the file is already packed, ensuring both tools report the same untested count. Batocera: verify 679/680 (1 untested), pack 358/359 (1 untested). Both report sc3000.zip as the single untested file. --- scripts/generate_pack.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index 53ff9873..17ce397b 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -305,13 +305,14 @@ def generate_pack( full_dest = dest dedup_key = full_dest - if dedup_key in seen_destinations: - continue - seen_destinations.add(dedup_key) + already_packed = dedup_key in seen_destinations storage = file_entry.get("storage", "embedded") if storage == "user_provided": + if already_packed: + continue + seen_destinations.add(dedup_key) instructions = file_entry.get("instructions", "Please provide this file manually.") instr_name = f"INSTRUCTIONS_{file_entry['name']}.txt" instr_path = f"{base_dest}/{instr_name}" if base_dest else instr_name @@ -343,13 +344,12 @@ def generate_pack( continue if status == "not_found": - missing_files.append(file_entry["name"]) + if not already_packed: + missing_files.append(file_entry["name"]) continue if status == "hash_mismatch": if verification_mode != "existence": - # 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 @@ -360,6 +360,10 @@ def generate_pack( else: untested_files.append(file_entry["name"]) + if already_packed: + continue + seen_destinations.add(dedup_key) + extract = file_entry.get("extract", False) if extract and local_path.endswith(".zip"): _extract_zip_to_archive(local_path, full_dest, zf)