Skip to content

Commit ef2db02

Browse files
committed
ci: fall back to the gnulib GitHub mirror for tests/init.sh
The savannah gitweb interface is regularly rate-limited or unavailable, so retry it and then fall back to the official gnulib mirror on GitHub rather than failing the whole GNU testsuite job.
1 parent 584c405 commit ef2db02

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

tests/run-upstream-testsuite.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,20 @@ cd ../tests || die "Cannot enter the upstream tests directory"
8282

8383
# Fetch tests/init.sh from the gnulib repository (needed since
8484
# https://git.savannah.gnu.org/cgit/diffutils.git/commit/tests?id=1d2456f539)
85-
curl -sL --fail --retry 3 --retry-delay 5 --retry-all-errors \
86-
"$gitserver/gitweb/?p=gnulib.git;a=blob_plain;f=tests/init.sh;hb=HEAD" -o init.sh \
87-
|| die "Failed to fetch tests/init.sh from the gnulib repository"
88-
[[ -s init.sh ]] || die "Fetched an empty tests/init.sh from the gnulib repository"
85+
# The savannah gitweb interface is often rate-limited or unavailable, so fall
86+
# back to the official gnulib mirror on GitHub
87+
initsh_urls=(
88+
"$gitserver/gitweb/?p=gnulib.git;a=blob_plain;f=tests/init.sh;hb=HEAD"
89+
"https://raw.githubusercontent.com/coreutils/gnulib/master/tests/init.sh"
90+
)
91+
for url in "${initsh_urls[@]}"
92+
do
93+
echo "Fetching tests/init.sh from $url"
94+
curl -sSL --fail --retry 3 --retry-delay 5 --retry-all-errors \
95+
--connect-timeout 30 --max-time 300 "$url" -o init.sh && [[ -s init.sh ]] && break
96+
rm -f init.sh
97+
done
98+
[[ -s init.sh ]] || die "Failed to fetch tests/init.sh from the gnulib repository"
8999

90100
if [[ -n "$TESTS" ]]
91101
then

0 commit comments

Comments
 (0)