Skip to content

Commit fef82b3

Browse files
authored
Merge pull request #112 from DrDaveD/do-retries
introduce curl retries
2 parents e8d2baf + ca32cb5 commit fef82b3

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- Properly sort the cvmfs version number from the downloaded list of packages.
33
- For osg use 24-main instead of 23-main.
44
- For suse15 switch to getting some packages from el8 instead of el7.
5+
- Retry rpm downloads up to 3 times if they fail.
56

67
cvmfsexec-4.45 - 5 March 2025
78
- Change to try downloading cvmfs packages from cvmrepo.s3.cern.ch and

makedist

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
SUPPORTEDTYPES="rhel7-x86_64 rhel8-aarch64 rhel8-x86_64 rhel8-ppc64le rhel9-aarch64 rhel9-x86_64 rhel9-ppc64le suse15-x86_64"
99
REQUIREDCMDS="curl rpm2cpio cpio"
1010

11+
CURLOPTS="--connect-timeout 5 -Y 125000 -y 10 -LsS"
12+
1113
supportedtypes() {
1214
typeset LASTDISTRO=""
1315
typeset TYPES=""
@@ -118,7 +120,7 @@ distroarch() {
118120

119121
# download and parse the listing from a package server (give URL as 1st argument)
120122
get_cvmfs_pkg_list() {
121-
echo "$(curl -Ls $1/|grep "cvmfs-"|sed 's/.*href="//;s/".*//;s,^\./,,')"
123+
echo "$(curl $CURLOPTS $1/|grep "cvmfs-"|sed 's/.*href="//;s/".*//;s,^\./,,')"
122124
}
123125

124126

@@ -384,7 +386,7 @@ latesturl()
384386
URL="${URL%/}"
385387
URL="$URL/${2:0:1}"
386388
fi
387-
typeset PKG="$(curl -Ls "$URL"|grep ${2}-[0-9].*$ARCH|grep -v 32bit|grep -v mirrorlist|tail -1|sed 's/.*href="//;s/".*//')"
389+
typeset PKG="$(curl $CURLOPTS "$URL"|grep ${2}-[0-9].*$ARCH|grep -v 32bit|grep -v mirrorlist|tail -1|sed 's/.*href="//;s/".*//')"
388390
if [ -n "$PKG" ]; then
389391
echo "$URL/$PKG"
390392
fi
@@ -472,10 +474,15 @@ VERSION_ID="$VERS"
472474

473475
for U in $URLS; do
474476
echo "Extracting $U into $DIST"
475-
if ! curl -Ls "$U"|rpm2cpio -|cpio -idmv -f "*/.build-id*"; then
476-
echo "Extracting $U failed!" >&2
477-
exit 1
478-
fi
477+
RETRY=0
478+
while ! curl $CURLOPTS "$U"|rpm2cpio -|cpio -idmv -f "*/.build-id*"; do
479+
let RETRY+=1
480+
if [ "$RETRY" -ge 3 ]; then
481+
echo "Extracting $U failed after $RETRY attempts, giving up!" >&2
482+
exit 1
483+
fi
484+
echo "failed, retrying ..." >&2
485+
done
479486
done
480487
find * -type l|while read LINK; do
481488
LINKDEST="`readlink $LINK`"

0 commit comments

Comments
 (0)