From fd36670532658294a72708bb41d77d604fd68bc6 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:20:44 +0100 Subject: [PATCH] fix: name --from-pack and the packs beside a typo --- install.ps1 | 2 +- install.py | 10 +++++++++- install.sh | 2 +- install/launchers/index.json | 16 ++++++++-------- tests/test_install.py | 14 ++++++++++++++ 5 files changed, 33 insertions(+), 11 deletions(-) diff --git a/install.ps1 b/install.ps1 index b9df7e509..d89008099 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 = "38182a427e302ef13f994bad06ec51b8270f1b5949d9c1f9663b46437fdcd1fd" + $defaultInstallSha256 = "37d1cbaddd22995b6390fcb95ed3d44d899f935bc93d288fe989d4dfae92775e" $maximumInstallerBytes = 2MB $installerExit = 0 $installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null } diff --git a/install.py b/install.py index 857d43831..467efbff8 100644 --- a/install.py +++ b/install.py @@ -10888,7 +10888,15 @@ class PackSource: elif path.is_file(): given.append(path) else: - raise ValueError(f"{path} does not exist") + # "X does not exist" named neither the option nor the packs + # beside it, where a typo in the name is the usual cause. + near = sorted(p.name for p in path.parent.glob("*_BIOS_Pack*.zip") + if p.is_file()) if path.parent.is_dir() else [] + beside = (f" The packs in {path.parent}: {', '.join(near[:3])}" + + (f" and {len(near) - 3} more" if len(near) > 3 else "") + "." + if near else "") + raise ValueError(f"{path} does not exist: --from-pack names a pack ZIP, " + f"its parts or the folder holding them.{beside}") if not given: raise ValueError(f"no pack ZIP in {', '.join(map(str, paths))}") packs: dict[str, list[Path]] = {} diff --git a/install.sh b/install.sh index c68d70d28..01f821f5d 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="38182a427e302ef13f994bad06ec51b8270f1b5949d9c1f9663b46437fdcd1fd" +DEFAULT_INSTALL_SHA256="37d1cbaddd22995b6390fcb95ed3d44d899f935bc93d288fe989d4dfae92775e" MAX_INSTALLER_BYTES=2097152 cleanup() { diff --git a/install/launchers/index.json b/install/launchers/index.json index 64455b830..9dc8fb5bf 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": 1087817, - "sha256": "38182a427e302ef13f994bad06ec51b8270f1b5949d9c1f9663b46437fdcd1fd", + "size": 1088455, + "sha256": "37d1cbaddd22995b6390fcb95ed3d44d899f935bc93d288fe989d4dfae92775e", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 1141444, - "sha256": "0a1054f931b20cb3dc4534304008aa3064af1f4ca6a9bab8f9659b506da4642d" + "size": 1142082, + "sha256": "cce8bbfd699e23eb524244c01141d0a3316a3c3b769c54d3367e924b8d428ed2" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 1087817, - "sha256": "38182a427e302ef13f994bad06ec51b8270f1b5949d9c1f9663b46437fdcd1fd", + "size": 1088455, + "sha256": "37d1cbaddd22995b6390fcb95ed3d44d899f935bc93d288fe989d4dfae92775e", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 1087817, - "sha256": "38182a427e302ef13f994bad06ec51b8270f1b5949d9c1f9663b46437fdcd1fd", + "size": 1088455, + "sha256": "37d1cbaddd22995b6390fcb95ed3d44d899f935bc93d288fe989d4dfae92775e", "executable": false }, { diff --git a/tests/test_install.py b/tests/test_install.py index d87715ade..a719d965c 100644 --- a/tests/test_install.py +++ b/tests/test_install.py @@ -4048,6 +4048,20 @@ def _install_run(env: dict, *argv: str, **kwargs) -> subprocess.CompletedProcess ) +class AMissingPackNamesTheOptionAndThePacksBeside(unittest.TestCase): + """A typo in --from-pack said "Error: X does not exist": not the option, + not the pack sitting next to the name typed.""" + + def test_the_pack_beside_is_named(self): + folder = Path(_tempdir(self)) + (folder / "RetroArch_BIOS_Pack.zip").write_bytes(b"") + with self.assertRaises(ValueError) as raised: + install.PackSource._resolve([folder / "RetroArch_BIOS_Pak.zip"]) + said = str(raised.exception) + self.assertIn("--from-pack names a pack ZIP", said) + self.assertIn(f"The packs in {folder}: RetroArch_BIOS_Pack.zip.", said) + + class RomMIsToldToScan(unittest.TestCase, _LoopbackRun): """RomM serves the firmware its library scan records, and the run ended on "installed" with no word of the scan the player waits on."""