From 8eacc0ab47fc45a93e0658d2d8193966fbd36e0c Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 29 Jun 2026 14:15:55 +0200 Subject: [PATCH] fix(ci): use bare shell vars in existing-version check (crow ${VAR} substitution) The merged HEAD-probe check still rebuilt everything: crow runs its own ${VAR} substitution over the commands before the shell executes, so the shell variables ${BASE} and ${VERSION} were blanked to empty (only matrix vars resolve at that stage). Every probed URL was therefore malformed and returned non-200, leaving r-versions-existing.txt empty. Use bare $name for shell variables and build the filename with printf, which avoids the ${VERSION}_1 brace requirement entirely. Matrix vars (${PLATFORM}, ${PLATFORM_ID}, ${ARCH_ID}) keep braces since crow resolves those correctly. Verified URL construction against the live bucket for apk, deb and rpm. --- .crow/build.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.crow/build.yaml b/.crow/build.yaml index c980b4b..18f126f 100644 --- a/.crow/build.yaml +++ b/.crow/build.yaml @@ -168,16 +168,18 @@ steps: # with an anonymous HEAD instead of listing the bucket. The filename mirrors # what nfpm produces in builder/package.${PLATFORM} (version/release pinned # to 1): r-_1_.{apk,deb} for alpine/ubuntu, R--1-1..rpm - # for el*. + # for el*. Shell variables must use bare $name, not ${name}: crow performs + # its own ${VAR} substitution on these commands before the shell runs, so + # ${VAR} for a shell var would be blanked out (only matrix vars resolve there). case "${PLATFORM}" in - alpine-*) FILE="r-VER_1_${ARCH_ID}.apk" ;; - ubuntu-*) FILE="r-VER_1_${ARCH_ID}.deb" ;; - *) FILE="R-VER-1-1.${ARCH_ID}.rpm" ;; + alpine-*) FMT="r-%s_1_%s.apk" ;; + ubuntu-*) FMT="r-%s_1_%s.deb" ;; + *) FMT="R-%s-1-1.%s.rpm" ;; esac BASE="https://s3.eu-central-003.backblazeb2.com/devxy-r-builds/${PLATFORM_ID}" : > r-versions-existing.txt for VERSION in $(cat r-versions-to-build.txt); do - URL="${BASE}/$(echo "$FILE" | sed "s/VER/${VERSION}/")" + URL="$BASE/$(printf "$FMT" "$VERSION" "${ARCH_ID}")" if [ "$(curl -s -o /dev/null -w '%{http_code}' -I "$URL")" = "200" ]; then echo "$VERSION" >> r-versions-existing.txt fi