fix: say the misplaced copies stay in place

This commit is contained in:
Abdessamad Derraz committed 2026-10-26 22:20:42 +01:00
1 parent e919d8478e
commit c64f3215ea
5 files changed
+32 -13

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@
$ErrorActionPreference = "Stop"
$defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
$defaultInstallSha256 = "b13b2ef42634a371e0fa8c55be5182e8fb04c09d7c456816e300150f507d8697"
$defaultInstallSha256 = "6cf53f4fb49a96cbb6a13a0517a51440ea86f873fcc711158638db9b41217f64"
$maximumInstallerBytes = 2MB
$installerExit = 0
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
+6 -2
View File
@@ -12641,7 +12641,9 @@ def _plan_lines(check: dict, dest: Path | None, state: TuiState) -> list:
f"{'is' if len(misplaced) == 1 else 'are'} in the wrong place, "
f"{'it' if len(misplaced) == 1 else 'they'} will be copied where the "
"emulators read "
f"{'it' if len(misplaced) == 1 else 'them'}.")
f"{'it' if len(misplaced) == 1 else 'them'}, your "
f"{'copy' if len(misplaced) == 1 else 'copies'} left as "
f"{'it is' if len(misplaced) == 1 else 'they are'}.")
if state.facts.get("writable") is False:
if state.os_type == "windows":
lines.append("Or run the installer as an administrator.")
@@ -13063,7 +13065,9 @@ def _tui_sources(state: TuiState, installed: int, failed: int) -> str:
name = _last_name(folder)
folders[name] = folders.get(name, 0) + 1
copied = fixed + sum(folders.values())
return sources_line(list(folders.items()), fixed, max(0, installed - copied), failed)
line = sources_line(list(folders.items()), fixed, max(0, installed - copied), failed)
# A fix copies: the misplaced files are the user's, never moved.
return line + (" Your copies at the wrong place were left as they are." if fixed else "")
def _unavailable(state: TuiState) -> tuple[list[dict], int]:
+1 -1
View File
@@ -18,7 +18,7 @@ esac
TEMP_INSTALLER=""
TEMP_DIRECTORY=""
DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
DEFAULT_INSTALL_SHA256="b13b2ef42634a371e0fa8c55be5182e8fb04c09d7c456816e300150f507d8697"
DEFAULT_INSTALL_SHA256="6cf53f4fb49a96cbb6a13a0517a51440ea86f873fcc711158638db9b41217f64"
MAX_INSTALLER_BYTES=2097152
cleanup() {
+8 -8
View File
@@ -27,8 +27,8 @@
{
"dest": "roms/ports/retrobios/install.py",
"repo_path": "install.py",
"size": 624131,
"sha256": "b13b2ef42634a371e0fa8c55be5182e8fb04c09d7c456816e300150f507d8697",
"size": 624453,
"sha256": "6cf53f4fb49a96cbb6a13a0517a51440ea86f873fcc711158638db9b41217f64",
"executable": false
},
{
@@ -71,8 +71,8 @@
"muos": {
"archive": {
"dest": "ARCHIVE/RetroBIOS.muxapp",
"size": 674834,
"sha256": "b7d51126f63aeff0d7ca790d887556619aeb566b7133fe66ef79f08a7f639929"
"size": 675156,
"sha256": "f3d238de327230cdde248efb9e4a2a24cf28724c82c2e73e84c3da75907f0651"
},
"members": [
{
@@ -85,8 +85,8 @@
{
"name": "RetroBIOS/install.py",
"repo_path": "install.py",
"size": 624131,
"sha256": "b13b2ef42634a371e0fa8c55be5182e8fb04c09d7c456816e300150f507d8697",
"size": 624453,
"sha256": "6cf53f4fb49a96cbb6a13a0517a51440ea86f873fcc711158638db9b41217f64",
"executable": false
},
{
@@ -159,8 +159,8 @@
{
"dest": ".config/modules/retrobios/install.py",
"repo_path": "install.py",
"size": 624131,
"sha256": "b13b2ef42634a371e0fa8c55be5182e8fb04c09d7c456816e300150f507d8697",
"size": 624453,
"sha256": "6cf53f4fb49a96cbb6a13a0517a51440ea86f873fcc711158638db9b41217f64",
"executable": false
},
{
+16 -1
View File
@@ -2004,8 +2004,10 @@ class CopyFromAnOldCard(unittest.TestCase):
self.recheck(state, [found("scph5500.bin", str(SYSTEM_DIR),
"nested folder: bios/scph5500.bin")])
text = " ".join(line.strip() for line in install.tui_view(state, 120, 40))
# tui_audit_4 P3-10.13: a fix copies, and the screen says the user's
# copy stays.
self.assertIn("1 file is in the wrong place, it will be copied where the emulators "
"read it.", text)
"read it, your copy left as it is.", text)
row = next(i for i, r in enumerate(install.tui_rows(state)) if r.action == "misplaced")
state.focus["plan"] = row
press(state, "enter")
@@ -2015,6 +2017,19 @@ class CopyFromAnOldCard(unittest.TestCase):
press(state, "esc")
self.assertEqual(state.screen, "plan")
def test_the_result_says_the_misplaced_copies_stay(self):
state = checked_state()
state.stack.append("result")
state.code = 0
state.summary = {"event": "summary", "mode": "install", "installed": 2,
"up_to_date": 0, "pending": 0, "failed": [], "skipped": [],
"left_out": [], "kept": [], "interrupted": False}
state.local_dests = {"scph5500.bin": (str(SYSTEM_DIR), "nested folder: bios/a")}
state.finished = [("scph5500.bin", True, ""), ("gba_bios.bin", True, "")]
text = " ".join(" ".join(install.tui_outcome(state)[1]).split())
self.assertIn("1 file fixed from copies already in the BIOS folder, 1 downloaded. "
"Your copies at the wrong place were left as they are.", text)
def test_a_local_copy_is_no_download_speed(self):
state = checked_state()
press(state, "enter")