fix: name save files left in the bios folder

This commit is contained in:
Abdessamad Derraz committed 2026-10-23 07:28:07 +02:00
1 parent 31614fa0e4
commit 81fd98b24c
4 files changed
+20 -3

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@
$ErrorActionPreference = "Stop"
$defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
$defaultInstallSha256 = "b50eda2089a5da5fe4cb18f86a214fe3d8c08f04649f4ba94167fd35ab5942ac"
$defaultInstallSha256 = "568d9399c5639db607cfc3944fa46a0dfa8d47741291d9346ed336cd2500eb00"
$maximumInstallerBytes = 2MB
$installerExit = 0
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
+4 -1
View File
@@ -6406,7 +6406,10 @@ def _found_elsewhere(
for path in matching or same_name:
rel = index.relative(path)
contents = "" if path in matching else ", with other contents"
if rel.endswith("/" + dest) and path.name == name:
# A dest below the save directory is not below this folder: a copy
# here under the same tail is in the wrong place, not too deep.
below = entry.get("root") != "save"
if below and rel.endswith("/" + dest) and path.name == name:
extra = rel[: -len(dest) - 1]
top = index.root.name
if extra.casefold() == top.casefold():
+1 -1
View File
@@ -18,7 +18,7 @@ esac
TEMP_INSTALLER=""
TEMP_DIRECTORY=""
DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
DEFAULT_INSTALL_SHA256="b50eda2089a5da5fe4cb18f86a214fe3d8c08f04649f4ba94167fd35ab5942ac"
DEFAULT_INSTALL_SHA256="568d9399c5639db607cfc3944fa46a0dfa8d47741291d9346ed336cd2500eb00"
MAX_INSTALLER_BYTES=2097152
cleanup() {
+14
View File
@@ -197,6 +197,20 @@ class CheckNamesWhyAFileIsRefused(Scratch):
self.assertIn("a name no core opens: its contents are at PSX BIOS (USA).bin, "
"rename it scph5501.bin", self.check())
def test_a_save_directory_file_left_in_the_bios_folder_is_in_the_wrong_folder(self):
"""A pack carries the save directory's files under saves/: extracted
into the BIOS folder they sit beside it, not too deep in it."""
self.place("saves/azahar/keys.txt", b"keys")
saves = self.root / "saves"
saves.mkdir()
install._SAVE_DIRS[self.dest] = install.SavePlace(saves, False)
self.addCleanup(install._SAVE_DIRS.pop, self.dest, None)
entry = _entry("azahar/keys.txt", b"keys", ["nintendo-3ds"], root="save")
found = install.diagnose([entry], [], [entry], self.dest)
self.assertEqual(found.reasons[id(entry)],
"wrong folder: it is at saves/azahar/keys.txt")
self.assertEqual(found.deep, {})
def test_each_flagged_file_says_where_its_cores_open_it(self):
self.complete("scph5501.bin", "pcsx/extra.bin")
out = self.check()