]> https://gitweb.dealii.org/ - candi.git/commitdiff
candi: included loop over MIRROR and SOURCE for archives
authorUwe Köcher <koecher@hsu-hamburg.de>
Thu, 29 Oct 2015 17:48:33 +0000 (18:48 +0100)
committerUwe Köcher <koecher@hsu-hamburg.de>
Thu, 29 Oct 2015 17:48:33 +0000 (18:48 +0100)
NOTES:
* untested version
* MIRROR variable in project-deal.II.cfg must be disabled for the final version

TODOs:
* MIRRORS for hg, git, svn ...

candi.sh
project-deal.II.cfg

index f992041c503c8d1327ac1c7950a600ee23ad17de..dbea518c26b899f996fb519032b0606a8778059d 100755 (executable)
--- a/candi.sh
+++ b/candi.sh
@@ -175,28 +175,41 @@ verify_archive() {
 
 download_archive () {
     ARCHIVE_FILE=$1
+
+    # Include (local) mirrors
+    if [ ! -z "${MIRROR}" ]; then
+        SOURCE="${MIRROR} ${SOURCE}"
+    fi
     
-    # Only download archives that do not exist
-    if [ ! -e ${ARCHIVE_FILE} ]; then
-        if [ ${DOWNLOADER} = "curl" ] && [ ${CURL_DOWNLOADER_AVAILABLE} = "true" ] ; then
-            curl -O ${SOURCE}${ARCHIVE_FILE} || { rm ${SOURCE}${ARCHIVE_FILE}; exit 1; }
-        else
-            if [ ${STABLE_BUILD} = false ] && [ ${USE_SNAPSHOTS} = true ]; then
-                wget --retry-connrefused --no-check-certificate --server-response -c ${SOURCE}${ARCHIVE_FILE} -O ${ARCHIVE_FILE} || { rm ${ARCHIVE_FILE}; exit 1; }
+    for source in ${SOURCE}
+    do
+        # Set up complete url
+        url=${source}${ARCHIVE_FILE}
+        
+        # Only download archives that do not exist
+        if [ ! -e ${ARCHIVE_FILE} ]; then
+            if [ ${DOWNLOADER} = "curl" ] && [ ${CURL_DOWNLOADER_AVAILABLE} = "true" ] ; then
+                curl -O ${url} || { rm ${ARCHIVE_FILE}; exit 1; }
             else
-                wget --retry-connrefused --no-check-certificate -c ${SOURCE}${ARCHIVE_FILE} -O ${ARCHIVE_FILE} || { rm ${ARCHIVE_FILE}; exit 1; }
+                if [ ${STABLE_BUILD} = false ] && [ ${USE_SNAPSHOTS} = true ]; then
+                    wget --retry-connrefused --no-check-certificate --server-response -c ${url} -O ${ARCHIVE_FILE} || { rm ${ARCHIVE_FILE}; exit 1; }
+                else
+                    wget --retry-connrefused --no-check-certificate -c ${url} -O ${ARCHIVE_FILE} || { rm ${ARCHIVE_FILE}; exit 1; }
+                fi
             fi
+        else
+            cecho ${GOOD} "Skipping download (archive file exists)"
         fi
-    else
-        cecho ${GOOD} "Skipping download (archive file exists)"
-    fi
-    
-    # Download again when using snapshots and unstable packages, but
-    # only when the timestamp has changed
-    if [ ${STABLE_BUILD} = false ] && [ ${USE_SNAPSHOTS} = true ]; then
-        wget --timestamping --retry-connrefused --no-check-certificate ${SOURCE}${ARCHIVE_FILE} || { rm ${SOURCE}${ARCHIVE_FILE}; exit 1; }
-        cecho ${GOOD} "Downloading new snap shot archive file..."
-    fi
+        
+        # Download again when using snapshots and unstable packages, but
+        # only when the timestamp has changed
+        if [ ${STABLE_BUILD} = false ] && [ ${USE_SNAPSHOTS} = true ]; then
+            wget --timestamping --retry-connrefused --no-check-certificate ${url} || { rm ${ARCHIVE_FILE}; exit 1; }
+            cecho ${GOOD} "Downloading new snap shot archive file..."
+        fi
+        
+        unset url
+    done
 
     # Make sure the archive was downloaded
     if [ ! -e ${ARCHIVE_FILE} ]; then
index 0fd1048b0f2e589b93cbeb49ac3a5f9c7350eb6c..70995a53370e41fad1bdfcba7f3914e56fde409d 100644 (file)
@@ -7,6 +7,10 @@
 PROJECT=deal.II
 CLEAN_BUILD=false
 
+#########################################################################
+# Set up a (local) mirror server url
+MIRROR="https://www.ces.clemson.edu/dealii/mirror/"
+
 #########################################################################
 #Choose components of deal.II
 DEAL_CONFOPTS=" \

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.