From 23f54803e617ef4aa45b6fec23fc467ef4c2449d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 24 Oct 2026 04:43:15 -0400 Subject: [PATCH] fix(tools): keep install-sam3.sh POSIX sh (no arrays for curl auth options) (#2760) The script runs under #!/bin/sh; on dash the array assignment was a syntax error. Pass the auth option and its value as two plain words. Co-authored-by: Claude Opus 5.5 --- tools/install-sam3.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/install-sam3.sh b/tools/install-sam3.sh index 9787d4a49..625c2dab0 100755 --- a/tools/install-sam3.sh +++ b/tools/install-sam3.sh @@ -92,19 +92,20 @@ fi # resume the server refuses (416) starts over instead of counting as done. fetch() { file=$1 dest=$2 resume=${3:-} + # POSIX sh has no arrays: the auth option and its value travel as two plain words. if [ -n "$TOKEN" ]; then - CURL_AUTH=(--config "$AUTH_FILE") + auth_opt=--config auth_val=$AUTH_FILE else # not secret (no token is sent); kept in argv only to mirror the authenticated call shape - CURL_AUTH=(-H "X-No-Auth: 1") + auth_opt=-H auth_val="X-No-Auth: 1" fi - code=$(curl --proto '=https' -fsSL ${resume:+-C -} "${CURL_AUTH[@]}" -w '%{http_code}' -o "$dest" "$BASE/$file") || true + code=$(curl --proto '=https' -fsSL ${resume:+-C -} "$auth_opt" "$auth_val" -w '%{http_code}' -o "$dest" "$BASE/$file") || true case "$code" in 200|206) return 0 ;; 416) echo "the partial download of $file doesn't match the server's; starting over" >&2 rm -f "$dest" - code=$(curl --proto '=https' -fsSL "${CURL_AUTH[@]}" -w '%{http_code}' -o "$dest" "$BASE/$file") || true + code=$(curl --proto '=https' -fsSL "$auth_opt" "$auth_val" -w '%{http_code}' -o "$dest" "$BASE/$file") || true [ "$code" = 200 ] && return 0 echo "download of $REPO/$file failed ($code)" >&2; return 1 ;; 401|403) echo "access denied to $REPO/$file (has your request for facebook/sam3 been approved?)" >&2; return 1 ;;