diff --git a/scripts/romset_recipes.py b/scripts/romset_recipes.py index 10ed04d0c..617e44034 100644 --- a/scripts/romset_recipes.py +++ b/scripts/romset_recipes.py @@ -290,7 +290,9 @@ def platform_targets(platforms_dir: str) -> dict[str, set[str]]: """Container MD5s the platforms pin, per archive name. ``zipped_file`` entries pin an inner ROM instead of the container, so - their MD5 is not an archive hash and is skipped. + their MD5 is not an archive hash and is skipped. So is a Recalbox md5, + the composite of the members (``zip_digest: composite``, Bios.cpp:64-68): + no container build can ever give it. """ targets: dict[str, set[str]] = defaultdict(set) for name in list_registered_platforms(platforms_dir): @@ -298,7 +300,11 @@ def platform_targets(platforms_dir: str) -> dict[str, set[str]]: for system in config.get("systems", {}).values(): for entry in system.get("files", []) or []: archive = entry.get("name", "") - if not archive.endswith(".zip") or entry.get("zipped_file"): + if ( + not archive.endswith(".zip") + or entry.get("zipped_file") + or entry.get("zip_digest") == "composite" + ): continue for value in str(entry.get("md5") or "").split(","): value = value.strip().lower() diff --git a/tests/test_romset_recipes.py b/tests/test_romset_recipes.py index 769345f22..7abee737a 100644 --- a/tests/test_romset_recipes.py +++ b/tests/test_romset_recipes.py @@ -246,6 +246,25 @@ class ReportsOverAFixture(unittest.TestCase): self.assertEqual(len(report["unreproducible"]), 1) self.assertEqual(report["unreproducible"][0]["recipes_tried"], ["v1"]) + def test_a_composite_md5_is_no_container_target(self): + """Recalbox hashes a ZIP by its members: its md5 names no archive bytes.""" + platforms = self.root / "platforms" + platforms.mkdir() + (platforms / "_registry.yml").write_text( + "platforms:\n demo:\n config: demo.yml\n zip_digest: composite\n", + encoding="utf-8", + ) + (platforms / "demo.yml").write_text( + "platform: Demo\nsystems:\n arcade:\n files:\n" + " - name: set.zip\n destination: set.zip\n" + f" md5: {'f' * 32}\n", + encoding="utf-8", + ) + self.db["indexes"]["by_md5"] = {} + + report = missing_report(self.recipes, self.pool, self.db, str(platforms)) + self.assertEqual(report, {"constructible": [], "unreproducible": [], "no_recipe": []}) + DAT = """