fix: keep --system packs among the verified packs

The pack suffix test of b20d65d12 missed the platform --system packs, which carry their system after it (_BIOS_Pack_Playstation.zip): their manifest was no longer injected and install.py refused them. A pack name holds _BIOS_Pack, then an optional tag, then .zip.
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 20:29:53 +01:00
1 parent 00df728797
commit 5749c66e32
2 files changed
+12 -2

No files matched your search

+6 -2
View File
@@ -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,
+6
View File
@@ -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)