Skip to content

Commit

Permalink
Retry in all curl calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Jun 30, 2020
1 parent 6126ef0 commit 8a4ad26
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 43 deletions.
4 changes: 3 additions & 1 deletion ci/azure-install-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ steps:
rustup self update
fi
else
curl -sSL https://sh.rustup.rs | sh -s -- -y --default-toolchain="$TOOLCHAIN" --profile=minimal
curl --retry 3 -sSfL https://sh.rustup.rs -o rustup-init.sh
sh rustup-init.sh -y --default-toolchain="$TOOLCHAIN" --profile=minimal
rm rustup-init.sh
echo "##vso[task.prependpath]$HOME/.cargo/bin"
fi
displayName: Install rustup
Expand Down
10 changes: 6 additions & 4 deletions docker/Dockerfile.arm-unknown-linux-gnueabihf
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh

RUN mkdir /usr/arm-linux-gnueabihf && \
cd /usr/arm-linux-gnueabihf && \
curl -L https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz | \
tar --strip-components 1 -xJ
RUN mkdir /usr/arm-linux-gnueabihf \
&& cd /usr/arm-linux-gnueabihf \
&& export TOOLCHAIN_VERSION=8.3-2019.03 \
&& curl --retry 3 -sSfL https://developer.arm.com/-/media/Files/downloads/gnu-a/${TOOLCHAIN_VERSION}/binrel/gcc-arm-${TOOLCHAIN_VERSION}-x86_64-arm-linux-gnueabihf.tar.xz -O \
&& tar --strip-components 1 -xJf gcc-arm-${TOOLCHAIN_VERSION}-x86_64-arm-linux-gnueabihf.tar.xz \
&& rm gcc-arm-${TOOLCHAIN_VERSION}-x86_64-arm-linux-gnueabihf.tar.xz

ENV PATH /usr/arm-linux-gnueabihf/bin:$PATH

Expand Down
2 changes: 1 addition & 1 deletion docker/android-ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ main() {
td="$(mktemp -d)"

pushd "${td}"
curl -O "${NDK_URL}"
curl --retry 3 -sSfL "${NDK_URL}" -O
unzip -q android-ndk-*.zip
pushd android-ndk-*
./build/tools/make_standalone_toolchain.py \
Expand Down
2 changes: 1 addition & 1 deletion docker/android-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ EOF
fi
done

curl -O https://storage.googleapis.com/git-repo-downloads/repo
curl --retry 3 -sSfL https://storage.googleapis.com/git-repo-downloads/repo -O
chmod +x repo

# this is the minimum set of modules that are need to build bionic
Expand Down
2 changes: 1 addition & 1 deletion docker/cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main() {

pushd "${td}"

curl -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-Linux-x86_64.sh" -o cmake.sh
curl --retry 3 -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-Linux-x86_64.sh" -o cmake.sh
sh cmake.sh --skip-license --prefix=/usr/local

popd
Expand Down
13 changes: 6 additions & 7 deletions docker/disabled/dragonfly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ main() {

mkdir "${td}"/{binutils,gcc}{,-build} "${td}/dragonfly"

curl "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.bz2" | \
tar -C "${td}/binutils" --strip-components=1 -xj
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.bz2" -O
tar -C "${td}/binutils" --strip-components=1 -xjf "binutils-${binutils}.tar.bz2"

curl "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.bz2" | \
tar -C "${td}/gcc" --strip-components=1 -xj
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.bz2" -O
tar -C "${td}/gcc" --strip-components=1 -xjf "gcc-${gcc}.tar.bz2"

pushd "${td}"

Expand Down Expand Up @@ -90,9 +90,8 @@ EOF
EOF
cd ..

curl "https://mirror-master.dragonflybsd.org/iso-images/dfly-x86_64-${dragonfly}.iso.bz2" | \
bzcat | \
bsdtar xf - -C "${td}/dragonfly" ./usr/include ./usr/lib ./lib
curl --retry 3 -sSfL "https://mirror-master.dragonflybsd.org/iso-images/dfly-x86_64-${dragonfly}.iso.bz2" -O
bzcat "dfly-x86_64-${dragonfly}.iso.bz2" | bsdtar xf - -C "${td}/dragonfly" ./usr/include ./usr/lib ./lib

cd binutils-build
../binutils/configure \
Expand Down
4 changes: 2 additions & 2 deletions docker/dropbear.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ main() {

pushd "${td}"

curl -L "https://matt.ucc.asn.au/dropbear/dropbear-${version}.tar.bz2" | \
tar --strip-components=1 -xj
curl --retry 3 -sSfL "https://matt.ucc.asn.au/dropbear/dropbear-${version}.tar.bz2" -O
tar --strip-components=1 -xjf "dropbear-${version}.tar.bz2"

# Remove some unwanted message
sed -i '/skipping hostkey/d' cli-kex.c
Expand Down
12 changes: 6 additions & 6 deletions docker/freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ main() {

mkdir "${td}"/{binutils,gcc}{,-build} "${td}/freebsd"

curl "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.bz2" | \
tar -C "${td}/binutils" --strip-components=1 -xj
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.bz2" -O
tar -C "${td}/binutils" --strip-components=1 -xjf "binutils-${binutils}.tar.bz2"

curl "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.bz2" | \
tar -C "${td}/gcc" --strip-components=1 -xj
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.bz2" -O
tar -C "${td}/gcc" --strip-components=1 -xjf "gcc-${gcc}.tar.bz2"

pushd "${td}"

Expand All @@ -57,8 +57,8 @@ main() {
;;
esac

curl "http://ftp.freebsd.org/pub/FreeBSD/releases/${bsd_arch}/10.2-RELEASE/base.txz" | \
tar -C "${td}/freebsd" -xJ ./usr/include ./usr/lib ./lib
curl --retry 3 -sSfL "http://ftp.freebsd.org/pub/FreeBSD/releases/${bsd_arch}/10.2-RELEASE/base.txz" -O
tar -C "${td}/freebsd" -xJf base.txz ./usr/include ./usr/lib ./lib

cd binutils-build
../binutils/configure \
Expand Down
8 changes: 5 additions & 3 deletions docker/musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ hide_output() {
}

main() {
local version=0.9.8

local dependencies=(
ca-certificates
curl
Expand All @@ -38,13 +40,13 @@ main() {
td="$(mktemp -d)"

pushd "${td}"
curl -L https://github.com/richfelker/musl-cross-make/archive/v0.9.8.tar.gz | \
tar --strip-components=1 -xz
curl --retry 3 -sSfL "https://github.com/richfelker/musl-cross-make/archive/v${version}.tar.gz" -O
tar --strip-components=1 -xzf "v${version}.tar.gz"

hide_output make install "-j$(nproc)" \
GCC_VER=6.4.0 \
MUSL_VER=1.1.22 \
DL_CMD='curl -C - -L -o' \
DL_CMD='curl --retry 3 -sSfL -C - -o' \
OUTPUT=/usr/local/ \
"${@}"

Expand Down
23 changes: 13 additions & 10 deletions docker/netbsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ main() {

mkdir "${td}"/{binutils,gcc}{,-build} "${td}/netbsd"

curl "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.bz2" | \
tar -C "${td}/binutils" --strip-components=1 -xj
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.bz2" -O
tar -C "${td}/binutils" --strip-components=1 -xjf "binutils-${binutils}.tar.bz2"

curl "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.bz2" | \
tar -C "${td}/gcc" --strip-components=1 -xj
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.bz2" -O
tar -C "${td}/gcc" --strip-components=1 -xjf "gcc-${gcc}.tar.bz2"

pushd "${td}"

Expand All @@ -51,16 +51,19 @@ main() {

local patch
for patch in "${patches[@]}"; do
patch="$(curl "${patch}")"
echo "${patch}" | patch -Np0
local patch_file
patch_file="$(mktemp)"
curl --retry 3 -sSfL "${patch}" -o "${patch_file}"
patch -Np0 < "${patch_file}"
rm "${patch_file}"
done
cd ..

curl ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/binary/sets/base.tgz | \
tar -C "${td}/netbsd" -xz ./usr/include ./usr/lib ./lib
curl --retry 3 -sSfL ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/binary/sets/base.tgz -O
tar -C "${td}/netbsd" -xzf base.tgz ./usr/include ./usr/lib ./lib

curl ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/binary/sets/comp.tgz | \
tar -C "${td}/netbsd" -xz ./usr/include ./usr/lib
curl --retry 3 -sSfL ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/binary/sets/comp.tgz -O
tar -C "${td}/netbsd" -xzf comp.tgz ./usr/include ./usr/lib

cd binutils-build
../binutils/configure \
Expand Down
4 changes: 2 additions & 2 deletions docker/qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ main() {

pushd "${td}"

curl -L "https://download.qemu.org/qemu-${version}.tar.xz" | \
tar --strip-components=1 -xJ
curl --retry 3 -sSfL "https://download.qemu.org/qemu-${version}.tar.xz" -O
tar --strip-components=1 -xJf "qemu-${version}.tar.xz"

local targets="${arch}-linux-user"
local virtfs=""
Expand Down
8 changes: 4 additions & 4 deletions docker/solaris.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ main() {

mkdir "${td}"/{binutils,gcc}{,-build} "${td}/solaris"

curl "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.xz" | \
tar -C "${td}/binutils" --strip-components=1 -xJ
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/binutils/binutils-${binutils}.tar.xz" -O
tar -C "${td}/binutils" --strip-components=1 -xJf "binutils-${binutils}.tar.xz"

curl "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.xz" | \
tar -C "${td}/gcc" --strip-components=1 -xJ
curl --retry 3 -sSfL "https://ftp.gnu.org/gnu/gcc/gcc-${gcc}/gcc-${gcc}.tar.xz" -O
tar -C "${td}/gcc" --strip-components=1 -xJf "gcc-${gcc}.tar.xz"

pushd "${td}"

Expand Down
2 changes: 1 addition & 1 deletion docker/xargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ main() {
export RUSTUP_HOME=/tmp/rustup
export CARGO_HOME=/tmp/cargo

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh
curl --retry 3 -sSfL https://sh.rustup.rs -o rustup-init.sh
sh rustup-init.sh -y --no-modify-path --profile minimal
rm rustup-init.sh

Expand Down

0 comments on commit 8a4ad26

Please sign in to comment.