fix: count data files in the check fetch line

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 19:35:27 +01:00
1 parent 0624d9f735
commit a78d5ea316
5 files changed
+28 -12

No files matched your search

+1 -1
View File
@@ -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 }
+5 -2
View File
@@ -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
+1 -1
View File
@@ -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() {
+8 -8
View File
@@ -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
},
{
+13
View File
@@ -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()