diff --git a/images/linux/scripts/helpers/install.sh b/images/linux/scripts/helpers/install.sh index 20a9822b..0843983e 100644 --- a/images/linux/scripts/helpers/install.sh +++ b/images/linux/scripts/helpers/install.sh @@ -11,12 +11,19 @@ download_with_retries() { local URL="$1" local DEST="${2:-.}" local NAME="${3:-${URL##*/}}" + local COMPRESSED="$4" + + if [ $COMPRESSED == "compressed" ]; then + COMMAND="curl $URL -4 -s --compressed -o '$DEST/$NAME'" + else + COMMAND="curl $URL -4 -s -o '$DEST/$NAME'" + fi echo "Downloading $URL..." i=20 while [ $i -gt 0 ]; do ((i--)) - curl $URL -4 -s -compressed -o "$DEST/$NAME" + eval $COMMAND if [ $? != 0 ]; then sleep 30 else diff --git a/images/linux/scripts/installers/pypy.sh b/images/linux/scripts/installers/pypy.sh index dc6d1c77..e47235af 100644 --- a/images/linux/scripts/installers/pypy.sh +++ b/images/linux/scripts/installers/pypy.sh @@ -72,7 +72,7 @@ function InstallPyPy # Installation PyPy uri="https://downloads.python.org/pypy/" -download_with_retries $uri "/tmp" "pypyUrls.html" +download_with_retries $uri "/tmp" "pypyUrls.html" compressed pypyVersions="$(cat /tmp/pypyUrls.html | grep 'linux64' | awk -v uri="$uri" -F'>|<' '{print uri$5}')" toolsetJson="$INSTALLER_SCRIPT_FOLDER/toolset.json"