fix: say in place only with data files in place

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 19:33:05 +01:00
1 parent aaaafd5771
commit 101757675b
6 files changed
+39 -13

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 = "fa8d130b046b1c1d1bc2e8da49905a7572d81ee95d023b483cdcf009a1d4a64c"
$defaultInstallSha256 = "02b1a66c6f9d63122c8064005ec6ae7c7504820c28e5027a5894aef209be7aa5"
$maximumInstallerBytes = 2MB
$installerExit = 0
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
+8 -1
View File
@@ -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)
+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="fa8d130b046b1c1d1bc2e8da49905a7572d81ee95d023b483cdcf009a1d4a64c"
DEFAULT_INSTALL_SHA256="02b1a66c6f9d63122c8064005ec6ae7c7504820c28e5027a5894aef209be7aa5"
MAX_INSTALLER_BYTES=2097152
cleanup() {
+8 -8
View File
@@ -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
},
{
+16
View File
@@ -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()
+5 -2
View File
@@ -565,8 +565,11 @@ Checking existing files...
```
<!-- /generated: run-check -->
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).