[Cmake-commits] CMake branch, next, updated. v3.5.1-783-g6aadc4a
Ben Boeckel
ben.boeckel at kitware.com
Fri Apr 1 13:17:40 EDT 2016
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 6aadc4a25a07856a81262946b514884df95f795f (commit)
via 272779ce6aa4dbf15e2791ca3f3f5cbf1ce57b39 (commit)
from 5d94f12a78d259d4453913f345b882067cf45333 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6aadc4a25a07856a81262946b514884df95f795f
commit 6aadc4a25a07856a81262946b514884df95f795f
Merge: 5d94f12 272779c
Author: Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Apr 1 13:17:39 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Apr 1 13:17:39 2016 -0400
Merge topic 'ep-tls-verify-git' into next
272779ce ExternalProject: Allow TLS_VERIFY for git clones
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=272779ce6aa4dbf15e2791ca3f3f5cbf1ce57b39
commit 272779ce6aa4dbf15e2791ca3f3f5cbf1ce57b39
Author: Samir Benmendil <me at rmz.io>
AuthorDate: Fri Apr 1 11:49:16 2016 -0400
Commit: Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Fri Apr 1 11:49:16 2016 -0400
ExternalProject: Allow TLS_VERIFY for git clones
Use the git config `http.sslVerify=false` to disable strict ssl for git
commands.
diff --git a/Help/release/dev/ep-tls-verify-git.rst b/Help/release/dev/ep-tls-verify-git.rst
new file mode 100644
index 0000000..3c727de
--- /dev/null
+++ b/Help/release/dev/ep-tls-verify-git.rst
@@ -0,0 +1,5 @@
+ep-tls-verify-git
+-----------------
+
+* The :module:`ExternalProject` module now uses ``TLS_VERIFY`` when fetching
+ from git repositories.
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 1185a81..8d8382f 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -499,7 +499,7 @@ define_property(DIRECTORY PROPERTY "EP_UPDATE_DISCONNECTED" INHERITED
"ExternalProject module."
)
-function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules src_name work_dir gitclone_infofile gitclone_stampfile)
+function(_ep_write_gitclone_script script_filename source_dir git_EXECUTABLE git_repository git_tag git_remote_name git_submodules src_name work_dir gitclone_infofile gitclone_stampfile tls_verify)
file(WRITE ${script_filename}
"if(\"${git_tag}\" STREQUAL \"\")
message(FATAL_ERROR \"Tag for git checkout should not be empty.\")
@@ -524,12 +524,18 @@ if(error_code)
message(FATAL_ERROR \"Failed to remove directory: '${source_dir}'\")
endif()
+set(git_options)
+if(NOT tls_verify)
+ list(APPEND git_options
+ -c http.sslVerify=false)
+endif()
+
# try the clone 3 times incase there is an odd git clone issue
set(error_code 1)
set(number_of_tries 0)
while(error_code AND number_of_tries LESS 3)
execute_process(
- COMMAND \"${git_EXECUTABLE}\" clone --origin \"${git_remote_name}\" \"${git_repository}\" \"${src_name}\"
+ COMMAND \"${git_EXECUTABLE}\" \${git_options} clone --origin \"${git_remote_name}\" \"${git_repository}\" \"${src_name}\"
WORKING_DIRECTORY \"${work_dir}\"
RESULT_VARIABLE error_code
)
@@ -544,7 +550,7 @@ if(error_code)
endif()
execute_process(
- COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
+ COMMAND \"${git_EXECUTABLE}\" \${git_options} checkout ${git_tag}
WORKING_DIRECTORY \"${work_dir}/${src_name}\"
RESULT_VARIABLE error_code
)
@@ -553,7 +559,7 @@ if(error_code)
endif()
execute_process(
- COMMAND \"${git_EXECUTABLE}\" submodule init ${git_submodules}
+ COMMAND \"${git_EXECUTABLE}\" \${git_options} submodule init ${git_submodules}
WORKING_DIRECTORY \"${work_dir}/${src_name}\"
RESULT_VARIABLE error_code
)
@@ -562,7 +568,7 @@ if(error_code)
endif()
execute_process(
- COMMAND \"${git_EXECUTABLE}\" submodule update --recursive ${git_submodules}
+ COMMAND \"${git_EXECUTABLE}\" \${git_options} submodule update --recursive ${git_submodules}
WORKING_DIRECTORY \"${work_dir}/${src_name}\"
RESULT_VARIABLE error_code
)
@@ -1777,6 +1783,11 @@ function(_ep_add_download_command name)
set(git_remote_name "origin")
endif()
+ get_property(tls_verify TARGET ${name} PROPERTY _EP_TLS_VERIFY)
+ if(NOT tls_verify)
+ set(tls_verify OFF)
+ endif()
+
# For the download step, and the git clone operation, only the repository
# should be recorded in a configured RepositoryInfo file. If the repo
# changes, the clone script should be run again. But if only the tag
@@ -1801,7 +1812,7 @@ function(_ep_add_download_command name)
#
_ep_write_gitclone_script(${tmp_dir}/${name}-gitclone.cmake ${source_dir}
${GIT_EXECUTABLE} ${git_repository} ${git_tag} ${git_remote_name} "${git_submodules}" ${src_name} ${work_dir}
- ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt
+ ${stamp_dir}/${name}-gitinfo.txt ${stamp_dir}/${name}-gitclone-lastrun.txt ${tls_verify}
)
set(comment "Performing download step (git clone) for '${name}'")
set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake)
-----------------------------------------------------------------------
Summary of changes:
Help/release/dev/ep-tls-verify-git.rst | 5 +++++
Modules/ExternalProject.cmake | 23 +++++++++++++++++------
2 files changed, 22 insertions(+), 6 deletions(-)
create mode 100644 Help/release/dev/ep-tls-verify-git.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list