]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use wget instead of curl. 6635/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 20 May 2018 08:27:08 +0000 (16:27 +0800)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sun, 20 May 2018 12:25:14 +0000 (20:25 +0800)
Also show a progress bar for the download, but be otherwise quiet.

contrib/utilities/download_clang_format

index 0a0f921b45a51d9aa0b7b0c698c425655d37d20e..a73956184793ad5c7e1b9997f3931d3f4960e879 100755 (executable)
@@ -59,13 +59,25 @@ then
     exit 1
 fi
 
-echo "Downloading and installing clang-format-6."
+echo "Downloading and installing clang-format-6 from ${URL}/${FILENAME}"
 mkdir "${CLANG_PATH}"
 
 tmpdir="${TMPDIR:-/tmp}/dealiiclang${RANDOM}${RANDOM}"
 mkdir -p "${tmpdir}"
 cd "${tmpdir}"
-curl -s -L "${URL}/${FILENAME}" -O > /dev/null
+if [ -x "$(command -v wget)" ]; then
+  echo "Using wget to download..."
+  wget -q --show-progress -L "${URL}/${FILENAME}" > /dev/null
+else
+  if [ -x "$(command -v curl)" ]; then
+    echo "Using curl to download..."
+    curl -s -L "${URL}/${FILENAME}" -O > /dev/null
+  else
+    echo "Error: Neither wget nor curl is available..."
+    exit 1
+  fi
+fi
+
 if echo "${CHECKSUM}" | "${CHECKSUM_CMD}" -c; then
   tar xfz "${FILENAME}" -C "${PRG}" > /dev/null
 else

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.