From a78d5ea31647de4c24cf0a314724180c9c552dd4 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:35:27 +0100 Subject: [PATCH] fix: count data files in the check fetch line --- install.ps1 | 2 +- install.py | 7 +++++-- install.sh | 2 +- install/launchers/index.json | 16 ++++++++-------- tests/test_install.py | 13 +++++++++++++ 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/install.ps1 b/install.ps1 index cf7abb20c..9de606cc6 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 = "57b285ce8de68f8ece0d1adb9f3b7a7fc8cda5ab7004c3601d5ef357353ab69e" + $defaultInstallSha256 = "a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index 89a945fab..b3c9ced2f 100644 --- a/install.py +++ b/install.py @@ -15584,8 +15584,11 @@ def _install(args: argparse.Namespace, real_stdout: TextIO) -> None: print(line) for line in unreadable_lines(unread, args.verbose): print(line) - print(_check_fetch_line(len(to_download) - len(copies), "the BIOS folder", - len(lacking))) + # The data files need the internet too: offline, "8164 files + # need the internet" stood under "10805 files not in place". + trees_fetched = trees_missing if LOCAL.pack is None else 0 + print(_check_fetch_line(len(to_download) - len(copies) + trees_fetched, + "the BIOS folder", len(lacking))) check_pending += len(to_download) elif trees_missing: # The screen's headline: "Everything is in place." stood diff --git a/install.sh b/install.sh index 5e88c6d10..83b870b2f 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="57b285ce8de68f8ece0d1adb9f3b7a7fc8cda5ab7004c3601d5ef357353ab69e" +DEFAULT_INSTALL_SHA256="a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/launchers/index.json b/install/launchers/index.json index 7d57d3af8..904161d8e 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": 1097676, - "sha256": "57b285ce8de68f8ece0d1adb9f3b7a7fc8cda5ab7004c3601d5ef357353ab69e", + "size": 1097921, + "sha256": "a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 1151303, - "sha256": "3df4d9dd45f830736e40d80be6ff589f22c91bff93ea00570918ef53a072e826" + "size": 1151548, + "sha256": "52812611b2593110809fb97339cfccd21ab2a1fdd3896db9220e66abdc94b384" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 1097676, - "sha256": "57b285ce8de68f8ece0d1adb9f3b7a7fc8cda5ab7004c3601d5ef357353ab69e", + "size": 1097921, + "sha256": "a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 1097676, - "sha256": "57b285ce8de68f8ece0d1adb9f3b7a7fc8cda5ab7004c3601d5ef357353ab69e", + "size": 1097921, + "sha256": "a04d2cf262c3ee0a6bcc073b0105b39af05c810ca64c82e62ebf03334fa6e2da", "executable": false }, { diff --git a/tests/test_install.py b/tests/test_install.py index fc0a75427..ba5a61eda 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -4830,6 +4830,19 @@ class RunsAgainstTheRealLists(unittest.TestCase, _LoopbackRun): self.assertIsNotNone(found, proc.stdout) self.assertIn(f"\n {found.group(2)} data files to fetch\n", proc.stdout) + def test_check_gives_one_total_offline(self): + """Offline on an empty folder: "10805 missing", then "8164 files not in + place" and "8164 files need the internet", the data files left out.""" + dest = self.home / "empty" + dest.mkdir() + proc = _install_run({**self.env, "RETROBIOS_INSTALL_OFFLINE": "1"}, "--platform", + "retroarch", "--dest", str(dest), "--check", "--no-input", + "--manifest", str(REPO_ROOT / "install" / "retroarch.json")) + self.assertEqual(proc.returncode, 1, proc.stdout + proc.stderr) + missing = re.search(r"0 in place, (\d+) missing", proc.stdout).group(1) + self.assertIn(f"\n {missing} files not in place:\n", proc.stdout) + self.assertIn(f" {missing} files need the internet", proc.stdout) + def test_a_cores_folder_can_be_named(self): cores = self.home / "cores" cores.mkdir()