From 5fccd662bdfef874b737646fd6027c99450c9758 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sun, 18 Oct 2026 20:42:13 +0200 Subject: [PATCH] fix: fold case in pack checks only where it folds --- scripts/packverify.py | 9 ++++++++- tests/test_hidden_extras.py | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/packverify.py b/scripts/packverify.py index 0fe648e7..ddff77e8 100644 --- a/scripts/packverify.py +++ b/scripts/packverify.py @@ -602,7 +602,14 @@ def verify_pack_against_platform( with zipfile.ZipFile(zip_path, "r") as zf: zip_set = set(zf.namelist()) - zip_lower = {n.lower(): n for n in zip_set} + # A case twin stands in for the file only where the platform's + # filesystem folds case, as the builder decides: on Lakka bios.col + # and BIOS.col are two files two cores open, and either one missing + # was counted present through the other. + zip_lower = ( + {n.lower(): n for n in zip_set} + if config.get("case_insensitive_fs", False) else {} + ) # Auto-detect flat vs nested ZIP is_flat = bool(base_dest) and not any( diff --git a/tests/test_hidden_extras.py b/tests/test_hidden_extras.py index 9e0f82ac..14eb8dd3 100644 --- a/tests/test_hidden_extras.py +++ b/tests/test_hidden_extras.py @@ -61,6 +61,21 @@ class OneRule(unittest.TestCase): ) +class TheIntegrityCheckFoldsCaseLikeTheBuilder(unittest.TestCase): + """--verify-packs counted a file present through its case twin on Lakka, + whose filesystem keeps bios.col and BIOS.col apart: a pack missing one + of the two passed step 6.""" + + def test_case_folding_reads_the_platform(self): + source = (REPO_ROOT / "scripts" / "packverify.py").read_text(encoding="utf-8") + compact = " ".join(source.split()) + self.assertRegex( + compact, + r"zip_lower = \( \{n\.lower\(\): n for n in zip_set\} " + r"if config\.get\(\"case_insensitive_fs\", False\) else \{\} \)", + ) + + class TheReportSaysSo(unittest.TestCase): """Reads the repository: skips when the database is absent."""