From 101757675be2b923fbf0311e56106db5dcca9291 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:33:05 +0100 Subject: [PATCH] fix: say in place only with data files in place --- install.ps1 | 2 +- install.py | 9 ++++++++- install.sh | 2 +- install/launchers/index.json | 16 ++++++++-------- tests/test_install.py | 16 ++++++++++++++++ wiki/installer.md | 7 +++++-- 6 files changed, 39 insertions(+), 13 deletions(-) diff --git a/install.ps1 b/install.ps1 index f0549a723..3e0fa3b13 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 = "fa8d130b046b1c1d1bc2e8da49905a7572d81ee95d023b483cdcf009a1d4a64c" + $defaultInstallSha256 = "02b1a66c6f9d63122c8064005ec6ae7c7504820c28e5027a5894aef209be7aa5" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index f887c308b..a1956f4d5 100644 --- a/install.py +++ b/install.py @@ -15554,7 +15554,10 @@ def _install(args: argparse.Namespace, real_stdout: TextIO) -> None: lacking = pack_lacks([f for f in to_download if id(f) not in copies]) if lacking: print(f"\n {pack_lacks_words(len(lacking), len(to_download) - len(copies))}") - print(f"\n {_plural(len(to_download), 'file')} " + # One total with the count above it, the data files among + # them as the screen counts them: "0 in place, 10805 missing" + # stood over "8164 files to download". + print(f"\n {_plural(len(to_download) + trees_missing, 'file')} " + ("not in place:" if offline or LOCAL.pack is not None else "to download:")) for line in check_lines(missing, mismatched, files, manifest, bios_path, @@ -15565,6 +15568,10 @@ def _install(args: argparse.Namespace, real_stdout: TextIO) -> None: print(_check_fetch_line(len(to_download) - len(copies), "the BIOS folder", len(lacking))) check_pending += len(to_download) + elif trees_missing: + # The screen's headline: "Everything is in place." stood + # above "0/169 data files present" and exit code 1. + print(f"\n {_plural(trees_missing, 'data file')} to fetch") else: print(f"\n {EVERYTHING_IN_PLACE}") absent = _absent_required(omitted_files, bios_path) diff --git a/install.sh b/install.sh index 17fab0cf5..83346b4a8 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="fa8d130b046b1c1d1bc2e8da49905a7572d81ee95d023b483cdcf009a1d4a64c" +DEFAULT_INSTALL_SHA256="02b1a66c6f9d63122c8064005ec6ae7c7504820c28e5027a5894aef209be7aa5" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/launchers/index.json b/install/launchers/index.json index 40d7f1510..9bf791423 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": 1096372, - "sha256": "fa8d130b046b1c1d1bc2e8da49905a7572d81ee95d023b483cdcf009a1d4a64c", + "size": 1096845, + "sha256": "02b1a66c6f9d63122c8064005ec6ae7c7504820c28e5027a5894aef209be7aa5", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 1149999, - "sha256": "143e0067766ccb85f299ca125c1dbdaa5ebec15e85ea49a9e354a677fb7f931d" + "size": 1150472, + "sha256": "b3261f3b02e6e4e14bbcba07d9f6f03b7b43e5e66bf20c770d4c68e8cb6bd277" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 1096372, - "sha256": "fa8d130b046b1c1d1bc2e8da49905a7572d81ee95d023b483cdcf009a1d4a64c", + "size": 1096845, + "sha256": "02b1a66c6f9d63122c8064005ec6ae7c7504820c28e5027a5894aef209be7aa5", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 1096372, - "sha256": "fa8d130b046b1c1d1bc2e8da49905a7572d81ee95d023b483cdcf009a1d4a64c", + "size": 1096845, + "sha256": "02b1a66c6f9d63122c8064005ec6ae7c7504820c28e5027a5894aef209be7aa5", "executable": false }, { diff --git a/tests/test_install.py b/tests/test_install.py index 4f75d11cf..fc0a75427 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -4814,6 +4814,22 @@ class RunsAgainstTheRealLists(unittest.TestCase, _LoopbackRun): self.assertIn("File list: RetroArch", proc.stdout) self.assertIn("--platform", proc.stdout) + def test_check_says_in_place_only_when_the_data_files_are_too(self): + """The PSP BIOS in place and PPSSPP's assets absent: --check said + "Everything is in place." then "169 to fetch", and exited 1.""" + dest = self.home / "psp" + (dest / "PPSSPP").mkdir(parents=True) + for repo_path in ("bios/Sony/PlayStation Portable/ppge_atlas.zim", + "bios/Other/ppsspp/PPSSPP/ppge_atlas.meta"): + shutil.copy(REPO_ROOT / repo_path, dest / "PPSSPP") + proc = _install_run(self.env, "--platform", "retroarch", "--dest", str(dest), + "--system", "sony-psp", "--check", "--no-input") + self.assertEqual(proc.returncode, 1, proc.stdout + proc.stderr) + self.assertNotIn("Everything is in place", proc.stdout) + found = re.search(r"(\d+) in place, (\d+) missing", proc.stdout) + self.assertIsNotNone(found, proc.stdout) + self.assertIn(f"\n {found.group(2)} data files to fetch\n", proc.stdout) + def test_a_cores_folder_can_be_named(self): cores = self.home / "cores" cores.mkdir() diff --git a/wiki/installer.md b/wiki/installer.md index a5d69e7ec..f19f96dc1 100644 --- a/wiki/installer.md +++ b/wiki/installer.md @@ -565,8 +565,11 @@ Checking existing files... ``` -The files the collection does not hold are listed after it again, as long as -they are absent from the folder. A number before `wrong copies` means a file is +`Everything is in place.` is said only when the data folders are complete +too. With the BIOS files in place and data files missing (PPSSPP's assets, +Dolphin's `Sys`), the line counts those instead (`169 data files to fetch`), +and `--check` exits with code 1. The files the collection does not hold are +listed after it again, as long as they are absent from the folder. A number before `wrong copies` means a file is in place with contents the platform does not accept. Running the install again replaces it and keeps the old one, see [Files you already had](#files-you-already-had).