diff --git a/scripts/pack_probe.py b/scripts/pack_probe.py index 665943f3b..bb4adbfe1 100644 --- a/scripts/pack_probe.py +++ b/scripts/pack_probe.py @@ -350,12 +350,18 @@ def map_run(layout: Layout, staged: set[str], rep: dict, profile: dict) -> tuple by_name: dict[str, list[str]] = {} for rel in layout.files: by_name.setdefault(rel.rsplit("/", 1)[-1].casefold(), []).append(rel) + # An entry the core found under one of its names asks for nothing more: + # BlastEm tries tmss.md, then reads bios_MD.bin, both names of one entry. + read = {item["path"] for item in opened if not item["created"]} + satisfied = {entry["name"] for entry in libretro_entries(profile) if read & set(entry_paths(entry))} findings = [] for path in rep.get("files_probed_absent") or (): names = declaring(profile, path) if path in layout.files: findings.append({"kind": "not_staged", "path": path, "declared_by": names, "paths": [path]}) continue + if names and set(names) <= satisfied: + continue elsewhere = sorted(p for p in by_name.get(path.rsplit("/", 1)[-1].casefold(), ()) if p != path) if elsewhere: kind = "elsewhere" diff --git a/tests/test_pack_probe.py b/tests/test_pack_probe.py index 9b255b86d..fbca00844 100644 --- a/tests/test_pack_probe.py +++ b/tests/test_pack_probe.py @@ -144,6 +144,15 @@ class Mapping(unittest.TestCase): {"kind": "missing_undeclared", "path": "cfg.ini", "declared_by": [], "paths": []}, {"kind": "unlisted", "path": "extra.bin", "declared_by": [], "paths": []}]) + def test_a_name_tried_before_an_alias_that_is_read_is_no_finding(self) -> None: + profile = {"files": [{"name": "tmss.md", "aliases": ["bios_MD.bin"]}, {"name": "bios_CD_U.bin"}]} + lay = layout({"bios_MD.bin": 1}) + rep = {"files_opened": [{"path": "bios_MD.bin", "sha1_after": "a" * 40}], + "files_probed_absent": ["tmss.md", "bios_CD_U.bin"]} + _, findings = pp.map_run(lay, {"bios_MD.bin"}, rep, profile) + self.assertEqual(findings, [{"kind": "missing_declared", "path": "bios_CD_U.bin", + "declared_by": ["bios_CD_U.bin"], "paths": []}]) + def test_manifest_entries(self) -> None: manifest = {"files": [{"dest": "a.bin"}], "case_variants": [{"dest": "A.BIN"}, {"dest": "a.bin"}], diff --git a/wiki/tools.md b/wiki/tools.md index 6337d2b38..52fce570b 100644 --- a/wiki/tools.md +++ b/wiki/tools.md @@ -1047,6 +1047,9 @@ with the pack entry that put it there, and the findings: | `not_staged` | the folder holds it, but the staging did not close within 6 runs | | `unlisted` | the core opened a file of the folder that no pack member or manifest entry names | +A name the core tried before it read another name of the same profile entry +is no finding: BlastEm tries `tmss.md`, then reads `bios_MD.bin`. + The run cannot see two things the platform does: core options a frontend sets (Batocera's configgen writes some), and the files the installer puts in the save directory, counted in `source.save_dir_files`. The Measurements page