]> https://gitweb.dealii.org/ - candi.git/commitdiff
allow checksum alternatives to fix trilinos download 127/head
authorTimo Heister <timo.heister@gmail.com>
Wed, 18 Dec 2019 21:54:54 +0000 (16:54 -0500)
committerTimo Heister <timo.heister@gmail.com>
Wed, 18 Dec 2019 21:54:54 +0000 (16:54 -0500)
- allow alternative checksums to be specified
- add a second checksum for trilinos as the original file changed

candi.sh
deal.II-toolchain/packages/trilinos.package

index f4c14a5c433d3465c6dc5c8395ef6c3ab2692500..2d50de69070c2db82f87f25b46f70dece513b29a 100755 (executable)
--- a/candi.sh
+++ b/candi.sh
@@ -222,30 +222,25 @@ verify_archive() {
 
     # Verify CHECKSUM using md5/md5sum
     if builtin command -v md5 > /dev/null; then
-        test "${CHECKSUM}" = "$(md5 -q ${ARCHIVE_FILE})"
-        if [ $? = 0 ]; then
-            echo "${ARCHIVE_FILE}: OK"
-            return 0
-        else
-            echo "${ARCHIVE_FILE}: FAILED"
-            return 3
-        fi
-
+       CURRENT="$(md5 -q ${ARCHIVE_FILE})"
     elif builtin command -v md5sum > /dev/null; then
-        echo "${CHECKSUM}  ${ARCHIVE_FILE}" | md5sum --check -
-        if [ $? = 0 ]; then
-            return 0
-        else
-            return 3
-        fi
-
+       CURRENT=$(md5sum ${ARCHIVE_FILE} | awk '{print $1}')
     else
         cecho ${BAD} "Neither md5 nor md5sum were found in the PATH"
         return 4
     fi
 
-    # Internal error: we should never reach this point, but to be sure we
-    return -1
+    for CHECK in ${CHECKSUM}; do
+        test "${CHECK}" = "${CURRENT}"
+        if [ $? = 0 ]; then
+            echo "${ARCHIVE_FILE}: OK"
+            return 0
+       fi
+    done
+
+    cecho ${BAD} "${ARCHIVE_FILE}: FAILED"
+    cecho ${BAD} "${CURRENT} does not match any in ${CHECKSUM}"
+    return 3
 }
 
 download_archive () {
index 53e73f3664135650201cb6513d990c1ef3044888..ffe01515d5ceaf19ae287104791708df9ab371ea 100644 (file)
@@ -3,8 +3,11 @@ if [ -z "${TRILINOS_MAJOR_VERSION}" ]; then
 fi
 
 if [ ${TRILINOS_MAJOR_VERSION} = "AUTO" ] || [ ${TRILINOS_MAJOR_VERSION} = "12" ]; then
+
+    # note: the official trilinos tarball changed md5sum but we confirmed that the contents is
+    # identical. We accept both hashes here.
     VERSION=12-10-1
-    CHECKSUM=40f28628b63310f9bd17c26d9ebe32b1
+    CHECKSUM="667333dbd7c0f031d47d7c5511fd0810 40f28628b63310f9bd17c26d9ebe32b1"
     
     #VERSION=12-4-2
     #CHECKSUM=4c25a757d86bde3531090bd900a2cea8

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.