|
8 | 8 | SUPPORTEDTYPES="rhel7-x86_64 rhel8-aarch64 rhel8-x86_64 rhel8-ppc64le rhel9-aarch64 rhel9-x86_64 rhel9-ppc64le suse15-x86_64" |
9 | 9 | REQUIREDCMDS="curl rpm2cpio cpio" |
10 | 10 |
|
| 11 | +CURLOPTS="--connect-timeout 5 -Y 125000 -y 10 -LsS" |
| 12 | + |
11 | 13 | supportedtypes() { |
12 | 14 | typeset LASTDISTRO="" |
13 | 15 | typeset TYPES="" |
@@ -118,7 +120,7 @@ distroarch() { |
118 | 120 |
|
119 | 121 | # download and parse the listing from a package server (give URL as 1st argument) |
120 | 122 | 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,^\./,,')" |
122 | 124 | } |
123 | 125 |
|
124 | 126 |
|
@@ -384,7 +386,7 @@ latesturl() |
384 | 386 | URL="${URL%/}" |
385 | 387 | URL="$URL/${2:0:1}" |
386 | 388 | 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/".*//')" |
388 | 390 | if [ -n "$PKG" ]; then |
389 | 391 | echo "$URL/$PKG" |
390 | 392 | fi |
@@ -472,10 +474,15 @@ VERSION_ID="$VERS" |
472 | 474 |
|
473 | 475 | for U in $URLS; do |
474 | 476 | 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 |
479 | 486 | done |
480 | 487 | find * -type l|while read LINK; do |
481 | 488 | LINKDEST="`readlink $LINK`" |
|
0 commit comments