fix: follow moved retrodeck folders under --dest

A run given --platform and --dest never detects, so retrodeck.json was
never read and a moved bios/ folder was ignored. MovedFolders looks the
root up on first use, is reset per run, and detection only warms it.
This commit is contained in:
Abdessamad Derraz committed 2026-11-22 00:58:06 +01:00
1 parent 9f3fc2e0c1
commit c4a129e200
10 files changed
+177 -54

No files matched your search

+2 -2
View File
@@ -29,7 +29,7 @@ from installer.host_fs import (
)
from installer.invocation import _INVOCATION
from installer.local_check import _digest_file, expected_hashes
from installer.paths import _MOVED_FOLDERS, _entry_path, _entry_place, _note_spelling, _safe_relative_path, spelled
from installer.paths import MOVED, _entry_path, _entry_place, _note_spelling, _safe_relative_path, spelled
from installer.text import _plural, format_size
if TYPE_CHECKING:
@@ -262,7 +262,7 @@ def _kept_slot(root: Path, value: object) -> tuple[Path, PurePosixPath]:
it, as _destination_path places it: a RetroDECK folder moved elsewhere
is its own folder."""
relative = _safe_relative_path(value, "dest")
moved = _MOVED_FOLDERS.get(root, {})
moved = MOVED.of(root)
if len(relative.parts) > 1 and relative.parts[0] in moved:
return moved[relative.parts[0]].resolve(), PurePosixPath(*relative.parts[1:])
return _note_spelling(root), relative