From 7da6e117a3f10b91b8b72dbd2747fe6eb323b60a Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:56:00 +0100 Subject: [PATCH] fix: read a RetroDECK bios dest as its folder --- install.ps1 | 2 +- install.py | 6 ++++++ install.sh | 2 +- install/launchers/index.json | 16 ++++++++-------- tests/test_install_experience.py | 21 +++++++++++++++++++++ 5 files changed, 37 insertions(+), 10 deletions(-) diff --git a/install.ps1 b/install.ps1 index d41b5047b..fbb39ad50 100644 --- a/install.ps1 +++ b/install.ps1 @@ -16,7 +16,7 @@ # and Invoke-WebRequest throws on a cut transfer before the hash is read: # the site's build rewrites this line there (scripts/sitebootstrap.py). $mismatchAdvice = "The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that." - $defaultInstallSha256 = "97857d0ba16eaa8be16a4c8832bf04b6ee6da1bcdbc0d747d1934cc3eb5ff909" + $defaultInstallSha256 = "9c9a29d182e9c4074197a4177e13c026e06c98defe0fc79ba820f1c696216213" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index ee9ba411e..48dfd738d 100644 --- a/install.py +++ b/install.py @@ -14074,6 +14074,12 @@ def _list_card_choice(plat: str, dest: Path) -> CardChoice: return CardChoice(plat, dest, f"{screen_text(str(dest))} holds the files of " f"{names}: installing into it as named. Name the card's BIOS " "folder with --dest to write there.") + if plat == "retrodeck" and dest.name.lower() == "bios" and not _is_dir(dest / "bios"): + # RetroDECK's list writes bios/, roms/ and the rest below its own + # folder: its BIOS folder, which --help asks for, got bios/bios. + return CardChoice(plat, dest.parent, f"{shown_path(dest)} is RetroDECK's BIOS " + f"folder: the files go below {shown_path(dest.parent)}, the " + "RetroDECK folder holding it") return CardChoice(plat, dest) diff --git a/install.sh b/install.sh index 6de052330..b3bd625c5 100755 --- a/install.sh +++ b/install.sh @@ -23,7 +23,7 @@ DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/ins # curl or wget stop on a cut transfer before the hash is read: the site's # build rewrites this line there (scripts/sitebootstrap.py). MISMATCH_ADVICE="The download was most likely cut short: try again. Within minutes of an update of this project the two files can come from caches of different ages. Waiting five minutes settles that." -DEFAULT_INSTALL_SHA256="97857d0ba16eaa8be16a4c8832bf04b6ee6da1bcdbc0d747d1934cc3eb5ff909" +DEFAULT_INSTALL_SHA256="9c9a29d182e9c4074197a4177e13c026e06c98defe0fc79ba820f1c696216213" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/launchers/index.json b/install/launchers/index.json index 9001e7fae..1672607f9 100644 --- a/install/launchers/index.json +++ b/install/launchers/index.json @@ -27,8 +27,8 @@ { "dest": "roms/ports/retrobios/install.py", "repo_path": "install.py", - "size": 1081112, - "sha256": "97857d0ba16eaa8be16a4c8832bf04b6ee6da1bcdbc0d747d1934cc3eb5ff909", + "size": 1081583, + "sha256": "9c9a29d182e9c4074197a4177e13c026e06c98defe0fc79ba820f1c696216213", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 1134739, - "sha256": "c0bdf23698273f62236ff5928d035086625532995322b453107cc1b81c365972" + "size": 1135210, + "sha256": "59914e1d36e1169d6a9b24314a8e64833a434fa8c6df05916257aa5007855b0f" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 1081112, - "sha256": "97857d0ba16eaa8be16a4c8832bf04b6ee6da1bcdbc0d747d1934cc3eb5ff909", + "size": 1081583, + "sha256": "9c9a29d182e9c4074197a4177e13c026e06c98defe0fc79ba820f1c696216213", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 1081112, - "sha256": "97857d0ba16eaa8be16a4c8832bf04b6ee6da1bcdbc0d747d1934cc3eb5ff909", + "size": 1081583, + "sha256": "9c9a29d182e9c4074197a4177e13c026e06c98defe0fc79ba820f1c696216213", "executable": false }, { diff --git a/tests/test_install_experience.py b/tests/test_install_experience.py index ba86703cb..7eab70c72 100644 --- a/tests/test_install_experience.py +++ b/tests/test_install_experience.py @@ -823,6 +823,27 @@ class APartlyClosedHome(unittest.TestCase): self.assertEqual([entry["bios_dir"] for entry in detect["platforms"]], [str(system)]) +class RetroDeckBiosFolderNamedAsDest(unittest.TestCase): + """`--platform retrodeck --dest ~/retrodeck/bios`, as --help asks for a + BIOS folder, put every file under bios/bios, which RetroDECK never reads.""" + + def test_the_files_go_below_the_retrodeck_folder(self): + root = Path(tempfile.mkdtemp(dir=REPO_ROOT / "tmp")) + self.addCleanup(shutil.rmtree, root, True) + (root / "bios").mkdir() + choice = install.card_choice("retrodeck", "retrodeck", root / "bios") + self.assertEqual(choice.folder, root) + self.assertIn("RetroDECK's BIOS folder", choice.note) + self.assertFalse(choice.refused) + + def test_the_retrodeck_folder_itself_is_kept(self): + root = Path(tempfile.mkdtemp(dir=REPO_ROOT / "tmp")) + self.addCleanup(shutil.rmtree, root, True) + (root / "bios").mkdir() + choice = install.card_choice("retrodeck", "retrodeck", root) + self.assertEqual((choice.folder, choice.note), (root, "")) + + class AnUnreadableRetroArchConfigIsSaid(unittest.TestCase): """A retroarch.cfg a `sudo retroarch` left at 0600 for root was read as no config at all: RetroArch was not found and nothing said why."""