From 475b6acf83faf8f8da654a6abc998d0de840244e Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 11 Nov 2026 17:41:53 +0100 Subject: [PATCH] fix: keep case variants and types in a pack run --- install.ps1 | 2 +- install.py | 18 +++++++++++------- install.sh | 2 +- install/launchers/index.json | 16 ++++++++-------- tests/test_install_journeys.py | 12 +++++++----- 5 files changed, 28 insertions(+), 22 deletions(-) diff --git a/install.ps1 b/install.ps1 index 7e80b09a6..ae4c13a39 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 = "e9e2ecce0d716d7ec6035a580eb2fff1fcd207f6b323752a360d4c666afe2b9f" + $defaultInstallSha256 = "367c20d31846e626baf9ed356bc9456d7a8e35d183ac3f376e4d9b9ba8a5763d" # The pin above refuses any changed byte: this cap only stops a body that # cannot be the installer (a sign-in portal's page) before it is hashed. $maximumInstallerBytes = 8MB diff --git a/install.py b/install.py index 29a15ae79..4facdc149 100644 --- a/install.py +++ b/install.py @@ -14044,11 +14044,11 @@ def write_pack(path: Path, manifest: bytes, members: list[PackMember], scratches: list[Path] = [] try: for index, (final, chosen) in enumerate(zip(finals, plan), 1): - handle, scratch = tempfile.mkstemp(prefix=f".{final.name}.", suffix=".partial", - dir=str(path.parent)) + handle, made = tempfile.mkstemp(prefix=f".{final.name}.", suffix=".partial", + dir=str(path.parent)) os.close(handle) - scratches.append(Path(scratch)) - with zipfile.ZipFile(scratch, "w", zipfile.ZIP_DEFLATED, + scratches.append(Path(made)) + with zipfile.ZipFile(made, "w", zipfile.ZIP_DEFLATED, compresslevel=PACK_COMPRESSLEVEL) as archive: if count > 1: archive.writestr( @@ -18439,12 +18439,16 @@ def _install(args: argparse.Namespace, real_stdout: TextIO) -> None: files = manifest.get("files", []) omitted_files = manifest.get("omitted_files", []) variants = manifest.get("case_variants", []) - # A ZIP keeps both spellings: the device installing it folds them. - case_kept = packing or keeps_case(bios_path) + case_kept = keeps_case(bios_path) if variants and case_kept: # The list is folded for Windows and macOS, but here bios.col and # BIOS.col are two files that two cores open. files = files + [{**variant, "case_variant": True} for variant in variants] + elif packing: + # A ZIP keeps both spellings, whatever drive it is written to: + # the device installing it folds them. + files = files + [{**variant, "case_variant": True} for variant in variants] + case_kept = True if not case_kept: files, folded = fold_case_twins(files) if folded: @@ -18600,7 +18604,7 @@ def _install(args: argparse.Namespace, real_stdout: TextIO) -> None: # one read from an unknown save directory left out. Said once the # choice is made, over the files it keeps (say_saves). display = display_name(plat_name, manifest) - unplaced = [] + unplaced: list[dict] = [] if not packing: # A pack keeps every root's files: the device installing it # places them. diff --git a/install.sh b/install.sh index 969043a8d..d059c2f9c 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="e9e2ecce0d716d7ec6035a580eb2fff1fcd207f6b323752a360d4c666afe2b9f" +DEFAULT_INSTALL_SHA256="367c20d31846e626baf9ed356bc9456d7a8e35d183ac3f376e4d9b9ba8a5763d" # The pin above refuses any changed byte: this cap only stops a body that # cannot be the installer (a sign-in portal's page) before it is hashed. MAX_INSTALLER_BYTES=8388608 diff --git a/install/launchers/index.json b/install/launchers/index.json index 79211db27..0bf3b3e9d 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": 1329027, - "sha256": "e9e2ecce0d716d7ec6035a580eb2fff1fcd207f6b323752a360d4c666afe2b9f", + "size": 1329206, + "sha256": "367c20d31846e626baf9ed356bc9456d7a8e35d183ac3f376e4d9b9ba8a5763d", "executable": false }, { @@ -71,8 +71,8 @@ "muos": { "archive": { "dest": "ARCHIVE/RetroBIOS.muxapp", - "size": 1382652, - "sha256": "8ed6c5418093bf40bec41197b99a67c1f244100dc1eba51a83e456620fb434b4" + "size": 1382831, + "sha256": "8de74ce7b0554380b4d2b3ec2702b70c3acdd0b8f8d20cba040366746eac2562" }, "members": [ { @@ -92,8 +92,8 @@ { "name": "RetroBIOS/install.py", "repo_path": "install.py", - "size": 1329027, - "sha256": "e9e2ecce0d716d7ec6035a580eb2fff1fcd207f6b323752a360d4c666afe2b9f", + "size": 1329206, + "sha256": "367c20d31846e626baf9ed356bc9456d7a8e35d183ac3f376e4d9b9ba8a5763d", "executable": false }, { @@ -166,8 +166,8 @@ { "dest": ".config/modules/retrobios/install.py", "repo_path": "install.py", - "size": 1329027, - "sha256": "e9e2ecce0d716d7ec6035a580eb2fff1fcd207f6b323752a360d4c666afe2b9f", + "size": 1329206, + "sha256": "367c20d31846e626baf9ed356bc9456d7a8e35d183ac3f376e4d9b9ba8a5763d", "executable": false }, { diff --git a/tests/test_install_journeys.py b/tests/test_install_journeys.py index 35a3bf388..3e0fa7351 100644 --- a/tests/test_install_journeys.py +++ b/tests/test_install_journeys.py @@ -61,21 +61,23 @@ JOURNEY_KEYS = { # word: its length is the machine's. A change that adds words raises a # number here and says why. JOURNEY_WORDS = { - "first_install": 47, - "card_with_games": 87, + # Every plan names More (one word, Make a pack being always there): one + # word per plan a journey stops on. + "first_install": 48, + "card_with_games": 88, # A plan whose folder has a record names More (one word): an update # and a second run of one system. "update": 71, - "one_system": 179, + "one_system": 181, "one_system_again": 68, # Change holds every option one level down now (design 4.4): its # headings and the rows for Emulators, a pack, the device and the # internet, the intro sentence dropped, 10 words on each of its two # frames. - "what_is_missing": 227, + "what_is_missing": 228, # The plan of the setup found comes first now (33 words), the setups # one Esc away, and the last plan names Change where (2 words). - "another_device": 265, + "another_device": 267, } # Which setup? names every setup, Preview every file: lists, not prose. SCREEN_CEILING = 90