Tighten the setup.sh fetch helper comments
This commit is contained in:
parent
a979cee564
commit
d901b70c0f
1 changed files with 7 additions and 9 deletions
|
|
@ -973,9 +973,8 @@ install_python_stack() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# ── HTTP GET to stdout (supports curl and wget) ──
|
# ── HTTP GET to stdout (supports curl and wget) ──
|
||||||
# install.sh accepts either transport everywhere (its download() and _http_get),
|
# install.sh takes either transport everywhere, so a wget-only box installs fine
|
||||||
# so a wget-only box gets that far and then stalled here, where curl was the only
|
# and then stalled here, where curl was the only way to fetch anything.
|
||||||
# way to fetch anything. Same preference order: curl, else wget.
|
|
||||||
_setup_http_get() {
|
_setup_http_get() {
|
||||||
if command -v curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
curl -LsSf "$1"
|
curl -LsSf "$1"
|
||||||
|
|
@ -987,12 +986,11 @@ _setup_http_get() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Same, with a deadline, for the checks that must not hang the install.
|
# Same, with a deadline, for the checks that must not hang the install.
|
||||||
# wget has no equivalent of curl's total-transfer --max-time: --timeout is per
|
# wget has nothing like curl's total-transfer --max-time: --timeout is per
|
||||||
# operation and it retries 20 times by default, so a stalled server dragged this
|
# operation and it retries 20 times, so a stalled server took minutes and a slow
|
||||||
# check out to minutes and a slow drip never ended it at all. --tries=1 plus an
|
# drip never ended. --tries=1 plus an outer `timeout` restores the 5s ceiling;
|
||||||
# outer `timeout` gives the same 5 second ceiling; without coreutils timeout
|
# without timeout (base macOS, which ships curl anyway) the per-operation bound
|
||||||
# (curl-less macOS would be the case, and macOS ships curl) we keep the
|
# stands rather than the check being dropped.
|
||||||
# per-operation bound rather than skipping the check.
|
|
||||||
_setup_http_get_timed() {
|
_setup_http_get_timed() {
|
||||||
if command -v curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
curl -fsSL --max-time 5 "$1"
|
curl -fsSL --max-time 5 "$1"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue