mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-06 01:53:56 -06:00
fix: name --from-pack and the packs beside a typo
This commit is contained in:
1 parent
3d694c7d70
commit
fd36670532
5 files changed
+33
-11
No files matched your search
+1
-1
@@ -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 }
|
||||
|
||||
+9
-1
@@ -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]] = {}
|
||||
|
||||
+1
-1
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in new issue
Block a user