]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake,make-dist: use sha256 instead of md5 for checksum
authorKefu Chai <kchai@redhat.com>
Wed, 18 Apr 2018 04:26:02 +0000 (12:26 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 20 Apr 2018 17:17:35 +0000 (01:17 +0800)
the boost's download page offers the SHA256 hash, so it'd be easier to
verify the hash this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/BuildBoost.cmake
make-dist

index 1bc28ad0f8203dd63ec9ae62ddc5c61eb8b28ced..90fac55370d5d80f36cae9c2f7ff4c410671b966 100644 (file)
@@ -140,7 +140,7 @@ function(do_build_boost version)
     # NOTE: If you change this version number make sure the package is available
     # at the three URLs below (may involve uploading to download.ceph.com)
     set(boost_version 1.66.0)
-    set(boost_md5 b2dfbd6c717be4a7bb2d88018eaccf75)
+    set(boost_256 5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9)
     string(REPLACE "." "_" boost_version_underscore ${boost_version} )
     set(boost_url 
       https://dl.bintray.com/boostorg/release/${boost_version}/source/boost_${boost_version_underscore}.tar.bz2)
@@ -152,7 +152,7 @@ function(do_build_boost version)
     endif()
     set(source_dir
       URL ${boost_url}
-      URL_MD5 ${boost_md5})
+      URL_HASH SHA256=${boost_sha256})
     if(CMAKE_VERSION VERSION_GREATER 3.1)
       list(APPEND source_dir DOWNLOAD_NO_PROGRESS 1)
     endif()
index 29493b1ffc44ec62e900fd2cbcb28ac18cae455c..b0083882fcef9a3ec8ae9d25efb8af530a9e91ac 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -23,7 +23,7 @@ fi
 download_boost() {
     boost_version=$1
     shift
-    boost_md5=$1
+    boost_sha256=$1
     shift
     boost_version_underscore=$(echo $boost_version | sed 's/\./_/g')
     boost_fname=boost_${boost_version_underscore}.tar.bz2
@@ -39,8 +39,8 @@ download_boost() {
         wget -c --no-verbose -O $boost_fname $url
         if [ $? != 0 -o ! -e $boost_fname ]; then
             echo "Download of $url failed"
-        elif [ $(md5sum $boost_fname | awk '{print $1}') != $boost_md5 ]; then
-            echo "Error: failed to download boost: MD5 mismatch."
+        elif [ $(sha256sum $boost_fname | awk '{print $1}') != $boost_sha256 ]; then
+            echo "Error: failed to download boost: SHA256 mismatch."
         else
             break
         fi
@@ -131,7 +131,7 @@ tar cvf $outfile.version.tar $outfile/src/.git_version $outfile/ceph.spec $outfi
 # NOTE: If you change this version number make sure the package is available
 # at the three URLs referenced below (may involve uploading to download.ceph.com)
 boost_version=1.66.0
-download_boost $boost_version b2dfbd6c717be4a7bb2d88018eaccf75 \
+download_boost $boost_version 5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9 \
                https://dl.bintray.com/boostorg/release/$boost_version/source \
                https://downloads.sourceforge.net/project/boost/boost/$boost_version \
                https://download.ceph.com/qa