]> https://gitweb.dealii.org/ - candi.git/commitdiff
Issue #4 : tests if curl is available on the system; if not, wget is used in any...
authorUwe Köcher <koecher@hsu-hamburg.de>
Thu, 10 Sep 2015 08:54:16 +0000 (10:54 +0200)
committerUwe Köcher <koecher@hsu-hamburg.de>
Thu, 10 Sep 2015 08:54:16 +0000 (10:54 +0200)
candi.sh

index 766d33d6a9f192c82ed895534baa570577cac181..573477c0eaefe76a6ba490a4a49a2a83c844d11f 100755 (executable)
--- 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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.