fix: keep the installer bootstraps of both batches

The tooling merge took its own install.sh and install.ps1, which only
moved the pin, and dropped the bootstrap checks of the installer
batch. The ported checksum test calls the TypeScript node helper of
its merged module, and the retrodeck excerpt follows the run.
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 16:36:17 +01:00
1 parent b90f8bb0b9
commit 9ea80dfb70
4 files changed
+74 -19

No files matched your search

+52 -2
View File
@@ -121,14 +121,29 @@ if [ -z "$INSTALLER" ] || [ ! -f "$INSTALLER" ]; then
INSTALLER="$TEMP_INSTALLER"
fi
# A Python can be built without ssl, unicodedata or zlib, and the installer
# needs all three: a python3 lacking ssl was chosen over a full python and
# every download then failed as if the network were down.
find_python() {
PYTHON=""
PYTHON_LACKING=""
PYTHON_OLD=""
for command_name in python3 python; do
if command -v "$command_name" >/dev/null 2>&1 \
&& "$command_name" -c 'import sys; raise SystemExit(sys.version_info < (3, 8))' 2>/dev/null; then
command -v "$command_name" >/dev/null 2>&1 || continue
if ! "$command_name" -c 'import sys; raise SystemExit(sys.version_info < (3, 8))' \
2>/dev/null; then
found_version=$("$command_name" -c \
'import sys; print("%d.%d.%d" % tuple(sys.version_info[:3]))' 2>/dev/null)
if [ -n "$found_version" ]; then
PYTHON_OLD=${PYTHON_OLD:-"$command_name here is $found_version"}
fi
continue
fi
if "$command_name" -c 'import ssl, unicodedata, zlib' 2>/dev/null; then
PYTHON=$command_name
return 0
fi
PYTHON_LACKING=${PYTHON_LACKING:-$command_name}
done
return 1
}
@@ -172,6 +187,20 @@ if ! find_python; then
esac
fi
fi
if [ -z "$PYTHON" ] && [ -n "$PYTHON_LACKING" ]; then
echo "Error: $PYTHON_LACKING is built without a module the installer needs" >&2
echo " (ssl, unicodedata or zlib). Run it with a full Python 3.8 or newer." >&2
exit 1
fi
if [ -z "$PYTHON" ] && [ -n "$PYTHON_OLD" ]; then
# Debian Buster ships 3.7: apt answers that python3 is already the newest
# version, and the same advice looped.
echo "Error: Python 3.8 or newer is required, and $PYTHON_OLD." >&2
echo " Install a newer one: from this system's packages if they offer one, by" >&2
echo " updating the system, or from https://www.python.org/downloads/." >&2
echo " Then run this command again." >&2
exit 1
fi
if [ -z "$PYTHON" ]; then
echo "Error: Python 3.8 or newer is required." >&2
if [ -n "$install_command" ]; then
@@ -183,6 +212,27 @@ if [ -z "$PYTHON" ]; then
exit 1
fi
# Termux reaches shared storage, where RetroArch keeps its system folder,
# once termux-setup-storage has run: the installer told the user to run it
# and start again. At a terminal the bootstrap runs it here. It only asks
# the Termux app, which shows Android's permission dialog and creates
# ~/storage once allowed: the wait gives the user time to answer.
case "${TERMUX_VERSION:-}:${PREFIX:-}" in
?*:*|*com.termux*)
if [ ! -d "$HOME/storage" ] && command -v termux-setup-storage >/dev/null 2>&1 \
&& (: </dev/tty) 2>/dev/null; then
echo "Android asks for the storage permission: allow it, so that the files reach" >/dev/tty
echo "the RetroArch folder." >/dev/tty
termux-setup-storage </dev/tty >/dev/tty 2>&1 || true
waited=0
while [ ! -d "$HOME/storage" ] && [ "$waited" -lt 60 ]; do
sleep 1
waited=$((waited + 1))
done
fi
;;
esac
# Piped from curl, standard input is this script, not the terminal: the
# installer would skip every question it can ask. Hand it the terminal when
# there is one.