[Cmake-commits] CMake branch, next, updated. v3.1.0-rc1-497-g224ece3

Brad King brad.king at kitware.com
Mon Nov 10 11:29:08 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  224ece3d2e7c8b4d5f1b8b0ce7dcd623812597d0 (commit)
       via  ee7405a6dbcc780c9ce720f20cbb25dde5f1b7f8 (commit)
      from  89dcb01ee34bc45f43f34cda1a72fa3abde7a153 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=224ece3d2e7c8b4d5f1b8b0ce7dcd623812597d0
commit 224ece3d2e7c8b4d5f1b8b0ce7dcd623812597d0
Merge: 89dcb01 ee7405a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 10 11:29:07 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 10 11:29:07 2014 -0500

    Merge topic 'ExternalProject-check-hash-before-download' into next
    
    ee7405a6 ExternalProject: Restore logic to not download already-existing file


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ee7405a6dbcc780c9ce720f20cbb25dde5f1b7f8
commit ee7405a6dbcc780c9ce720f20cbb25dde5f1b7f8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Nov 10 11:09:12 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Nov 10 11:26:52 2014 -0500

    ExternalProject: Restore logic to not download already-existing file
    
    The change in commit v3.1.0-rc1~85^2 (ExternalProject: Fix download
    retry logic, 2014-09-13) dropped the file(DOWNLOAD) EXPECTED_HASH
    argument.  This prevents file(DOWNLOAD) from skipping the download if
    the output file already exists with the proper hash.  Restore this check
    with explicit code in the download script.
    
    Reported-by: Ruslan Baratov <ruslan_baratov at yahoo.com>

diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index d6a6b72..cdd3039 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -628,6 +628,19 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p
     set(show_progress "SHOW_PROGRESS")
   endif()
 
+  if("${hash}" MATCHES "${_ep_hash_regex}")
+    string(CONCAT hash_check
+      "if(EXISTS \"${local}\")\n"
+      "  file(\"${CMAKE_MATCH_1}\" \"${local}\" hash_value)\n"
+      "  if(\"x\${hash_value}\" STREQUAL \"x${CMAKE_MATCH_2}\")\n"
+      "    return()\n"
+      "  endif()\n"
+      "endif()\n"
+      )
+  else()
+    set(hash_check "")
+  endif()
+
   # check for curl globals in the project
   if(DEFINED CMAKE_TLS_VERIFY)
     set(tls_verify "set(CMAKE_TLS_VERIFY ${CMAKE_TLS_VERIFY})")
@@ -651,7 +664,7 @@ function(_ep_write_downloadfile_script script_filename remote local timeout no_p
   endif()
 
   file(WRITE ${script_filename}
-"message(STATUS \"downloading...
+"${hash_check}message(STATUS \"downloading...
      src='${remote}'
      dst='${local}'
      timeout='${timeout_msg}'\")

-----------------------------------------------------------------------

Summary of changes:
 Modules/ExternalProject.cmake |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list