fix: drop names DraStic never opens

DraStic opens nds_bios_arm9.bin, nds_bios_arm7.bin and nds_firmware.bin and checks their size. Its nine aliases are in none of its binaries, and neither platform launcher passes them: ROCKNIX links the two BIOS names from its bios folder, and RetroPie runs DraStic from $md_conf_root/nds/drastic (drastic.sh:48), now a passes_path record. The collection answers DraStic's names with its DS dumps in generate_db, where repository names belong.
This commit is contained in:
Abdessamad Derraz committed 2026-10-21 12:44:33 +02:00
1 parent 20829d09ce
commit 8036d36fe8
7 files changed
+143 -11

No files matched your search

+6 -3
View File
@@ -614,9 +614,12 @@ def _collect_all_aliases(files: dict) -> dict:
["sgb2_bios.bin", "sgb2_boot.bin", "sgb2.boot.rom"],
["sgb1.program.rom", "SGB1.sfc/program.rom"],
["sgb2.program.rom", "SGB2.sfc/program.rom"],
# Nintendo DS
["bios7.bin", "nds7.bin"],
["bios9.bin", "nds9.bin"],
# Nintendo DS. DraStic opens nds_bios_arm9.bin, nds_bios_arm7.bin
# and nds_firmware.bin and checks their size only: the collection
# answers those names with its DS dumps.
["NDS_Bios7.bin", "bios7.bin", "nds7.bin", "nds_bios_arm7.bin"],
["NDS_Bios9.bin", "bios9.bin", "nds9.bin", "nds_bios_arm9.bin"],
["NDS_Lite_Firmware.bin", "nds_firmware.bin"],
["dsi_sd_card.bin", "nds_sd_card.bin"],
# MSX
["MSX.ROM", "MSX.rom", "Machines/Shared Roms/MSX.rom"],
+32
View File
@@ -48,6 +48,11 @@ OUTSIDE_BIOS: dict[str, tuple[str, ...]] = {
"gngeopi": ("-B",), # gngeo -B/--biospath <directory of neogeo.zip>
}
# Packages whose emulator reads its system files below the working directory
# the generated launch script enters with pushd, a folder outside $biosdir:
# DraStic opens system/<name> under it. Each must still pushd.
WORKING_DIRECTORY: tuple[str, ...] = ("drastic",)
_FUNCTION = re.compile(r"^function\s+([\w.+-]+)\s*\(\)\s*\{\s*$")
_ASSIGN = re.compile(r"^(?:local\s+)?([A-Za-z_]\w*)=(.*)$")
_DECLARE = re.compile(r"^local\s+([A-Za-z_]\w*(?:\s+[A-Za-z_]\w*)*)\s*$")
@@ -518,6 +523,7 @@ class PackageReader:
if links:
self._links(links)
self._outside_bios(events)
self._working_directory(events)
return self.records
@staticmethod
@@ -821,6 +827,32 @@ class PackageReader:
)
def _working_directory(self, events: list[Event]) -> None:
"""The folder a generated launch script enters before it runs the emulator."""
if self.package.id not in WORKING_DIRECTORY:
return
found = False
for event in events:
if not event.heredoc or not event.words or event.words[0] != ["pushd"]:
continue
script = _redirect_target(event.opener)
if script is None or len(event.words) != 2 or len(event.words[1]) != 1:
raise LauncherPatternMissing(
f"{event.path}:{event.line}", f"pushd outside a launch script: {event.raw}"
)
found = True
self.record(
"passes_path", [], [(event.path, event.line)],
search_dir=event.words[1][0].strip("\"'"),
passes_to=f"working directory of {script}",
fails_when_missing=False, depends_on_option=self._depends(event),
)
if not found:
raise LauncherPatternMissing(
self.package.path, "the launch script no longer enters a working directory"
)
def _redirect_target(words: list[list[str]]) -> str | None:
"""The file a `cat > FILE << EOF` or `cat << EOF >> FILE` line writes."""
flat = [w[0] for w in words if w]