From: Uwe Köcher Date: Thu, 10 Sep 2015 08:54:16 +0000 (+0200) Subject: Issue #4 : tests if curl is available on the system; if not, wget is used in any... X-Git-Tag: v0.7~26 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=143fbdb2400e366388776b6590d6785d80042741;p=candi.git Issue #4 : tests if curl is available on the system; if not, wget is used in any case --- diff --git a/candi.sh b/candi.sh index 766d33d..573477c 100755 --- a/candi.sh +++ b/candi.sh @@ -34,6 +34,12 @@ else DATE_CMD=$(which date) fi +if builtin command -v curl > /dev/null; then + CURL_DOWNLOADER_AVAILABLE=true +else + CURL_DOWNLOADER_AVAILABLE=false +fi + # Start global timer TIC_GLOBAL="$(${DATE_CMD} +%s%N)" @@ -83,7 +89,7 @@ package_fetch () { if [ ${PACKING} = ".tar.bz2" ] || [ ${PACKING} = ".tar.gz" ] || [ ${PACKING} = ".tbz2" ] || [ ${PACKING} = ".tgz" ] || [ ${PACKING} = ".tar.xz" ] || [ ${PACKING} = ".zip" ]; then # Only download archives that do not exist if [ ! -e ${NAME}${PACKING} ]; then - if [ ${DOWNLOADER} = "curl" ]; then + if [ ${DOWNLOADER} = "curl" ] && [${CURL_DOWNLOADER_AVAILABLE} = "true" ] ; then curl -O ${SOURCE}${NAME}${PACKING} else if [ ${STABLE_BUILD} = false ] && [ ${USE_SNAPSHOTS} = true ]; then