refactor: read a declaration's slot one way

model.declarations.declared_slot(entry, prefix) is the declared
destination less the platform's BIOS root, empty when the entry names no
path. platform_declarations, platform_declared_contents,
declared_destinations, system_core_reach, find_collisions and
platform_claims read it in place of destination-or-name. The core extras
of the builder and the manifest read declared_destination, and the
builder's case twin list asks Placed.block.

Behavior: the 134 EmuDeck system:md5 entries (destination: '') claim no
slot. They were filed under their name, sony-playstation:<md5>, a path
nothing else names: slots and collisions drop those claims, and
case_folded_slots skips an empty slot. Their names and contents still
count as declared, in the root folder as before.
This commit is contained in:
Abdessamad Derraz committed 2026-11-20 20:03:26 +01:00
1 parent c2dc50db50
commit 0095b23512
8 files changed
+36 -27

No files matched your search

+2 -4
View File
@@ -22,7 +22,7 @@ from dataclasses import dataclass
from core.hashing import parse_hash_list
from model.database import record_at
from model.declarations import CONFIGS_ROOT, ROMS_ROOT, declared_root, outer_layout
from model.declarations import CONFIGS_ROOT, ROMS_ROOT, declared_root, declared_slot, outer_layout
from model.profiles import lists_files
from resolve.content import name_match_size_ok
from resolve.localfile import resolve_local_file
@@ -1253,9 +1253,7 @@ def declared_destinations(config: dict) -> set[str]:
found: set[str] = set()
for system in config.get("systems", {}).values():
for entry in system.get("files", []):
slot = sanitize_pack_path(entry.get("destination") or entry.get("name", ""))
if prefix and slot.lower().startswith(prefix.lower() + "/"):
slot = slot[len(prefix) + 1:]
slot = declared_slot(entry, prefix)
if slot:
found.add(slot)
return found