Accept wget in studio/setup.sh, as install.sh already does

install.sh takes either transport everywhere: download() and _http_get both try
curl then wget, and the transport gate only fires when both are missing. A
wget-only box therefore installs fine, reaches studio/setup.sh, and finds curl
as the only way to fetch anything there.

Two sites: the uv bootstrap, where the fallback is silent (USE_UV stays false and
fast_install degrades to python -m pip), and the PyPI version check. Both now go
through a helper with install.sh's preference order.

Verified in a PATH containing wget but no curl: both helpers return 0 and the uv
installer is fetched, while the bare `curl -LsSf` this replaces exits 127.
This commit is contained in:
Daniel Han 2026-07-29 08:35:20 +00:00
commit 9c3e14acc0

View file

@ -972,14 +972,39 @@ install_python_stack() {
python "$SCRIPT_DIR/install_python_stack.py"
}
# ── HTTP GET to stdout (supports curl and wget) ──
# install.sh accepts either transport everywhere (its download() and _http_get),
# so a wget-only box gets that far and then stalled here, where curl was the only
# way to fetch anything. Same preference order: curl, else wget.
_setup_http_get() {
if command -v curl >/dev/null 2>&1; then
curl -LsSf "$1"
elif command -v wget >/dev/null 2>&1; then
wget -qO- "$1"
else
return 1
fi
}
# Same, with a deadline, for the checks that must not hang the install.
_setup_http_get_timed() {
if command -v curl >/dev/null 2>&1; then
curl -fsSL --max-time 5 "$1"
elif command -v wget >/dev/null 2>&1; then
wget -qO- --timeout=5 "$1"
else
return 1
fi
}
USE_UV=false
if command -v uv &>/dev/null; then
USE_UV=true
elif {
if _is_verbose; then
curl -LsSf https://astral.sh/uv/install.sh | sh
_setup_http_get https://astral.sh/uv/install.sh | sh
else
curl -LsSf https://astral.sh/uv/install.sh | sh > /dev/null 2>&1
_setup_http_get https://astral.sh/uv/install.sh | sh > /dev/null 2>&1
fi
}; then
export PATH="$HOME/.local/bin:$PATH"
@ -1020,7 +1045,7 @@ import sys; from importlib.metadata import version
print(version(sys.argv[1]))
" "$_PKG_NAME" 2>/dev/null || echo "")
LATEST_VER=$(curl -fsSL --max-time 5 "https://pypi.org/pypi/$_PKG_NAME/json" 2>/dev/null \
LATEST_VER=$(_setup_http_get_timed "https://pypi.org/pypi/$_PKG_NAME/json" 2>/dev/null \
| "$VENV_DIR/bin/python" -c "import sys,json; print(json.load(sys.stdin)['info']['version'])" 2>/dev/null \
|| echo "")