diff --git a/scripts/generate_pack.py b/scripts/generate_pack.py index b4b8fd31c..b41606dba 100644 --- a/scripts/generate_pack.py +++ b/scripts/generate_pack.py @@ -5083,7 +5083,8 @@ def _pack_archives(output_dir: str) -> list[str]: A part of a split pack holds a share of a platform by design and was checked against the whole when it was cut: judged as a pack it would fail conformance, and injecting a manifest would change published bytes. - Every name the builder gives ends in the pack suffix: build_port.py + Every name the builder gives holds `_BIOS_Pack`, then the system tag of + a --system platform pack (`_BIOS_Pack_Playstation.zip`): build_port.py writes its launcher archives (RetroBIOS.zip) to the same dist/, and taking every ZIP rewrote them with a manifest after build_port had printed their hashes. @@ -5091,10 +5092,13 @@ def _pack_archives(output_dir: str) -> list[str]: return sorted( name for name in os.listdir(output_dir) - if name.endswith(split_pack.PACK_SUFFIX) and not split_pack.is_part(name) + if _PACK_NAME.search(name) and not split_pack.is_part(name) ) +_PACK_NAME = re.compile(r"_BIOS_Pack(?:_[^/]+)?\.zip$") + + def verify_and_finalize_packs( output_dir: str, db: dict, diff --git a/tests/test_split_pack.py b/tests/test_split_pack.py index 99d54b4fb..2ae04dcde 100644 --- a/tests/test_split_pack.py +++ b/tests/test_split_pack.py @@ -240,6 +240,12 @@ class PartsAreNotTakenForPacks(SplitFixture): self._build(self.dist / name, {"RetroBIOS.sh": b"#!/bin/sh\n"}) before = {p.name: p.read_bytes() for p in self.dist.glob("RetroBIOS*.zip")} self.assertEqual(builder._pack_archives(str(self.dist)), [self.pack.name]) + # A --system platform pack carries its system after the suffix. + system = self.dist / "Demo_1.0_BIOS_Pack_Playstation.zip" + self._build(system, {"one.bin": b"1"}) + self.assertEqual(builder._pack_archives(str(self.dist)), + sorted([self.pack.name, system.name])) + system.unlink() with contextlib.redirect_stdout(io.StringIO()): builder.verify_and_finalize_packs(str(self.dist), {"files": {}, "indexes": {}}, skip_conformance=True)