summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2021-02-18 15:30:03 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2021-02-23 17:26:08 +0200
commit9e259d58c2a898800463d28b175fde0e74ab96d9 (patch)
tree7639958d44d781754f1c240bb338a7c7450f6b21
parent787c47586e809c512d5e6dbd2b66645294ad0adc (diff)
downloadmariadb-git-9e259d58c2a898800463d28b175fde0e74ab96d9.tar.gz
Remove race condition during `make dist`
Introduced by 85828b8f22e7f4dfa6a5d4b0a1ab9e133e7feea7 This is running 2 git processes in parallel, which, if unlucky can cause either of them to fail with "File already exists" error.
-rw-r--r--cmake/make_dist.cmake.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in
index 11b46f1c15b..4bc68d5edf9 100644
--- a/cmake/make_dist.cmake.in
+++ b/cmake/make_dist.cmake.in
@@ -43,6 +43,13 @@ IF(GIT_EXECUTABLE)
MESSAGE(STATUS "Running git checkout-index")
EXECUTE_PROCESS(
COMMAND "${GIT_EXECUTABLE}" checkout-index --all --prefix=${PACKAGE_DIR}/
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ RESULT_VARIABLE RESULT
+ )
+ IF(NOT RESULT EQUAL 0)
+ SET(GIT_EXECUTABLE)
+ ENDIF()
+ EXECUTE_PROCESS(
COMMAND "${GIT_EXECUTABLE}" submodule foreach "${GIT_EXECUTABLE} checkout-index --all --prefix=${PACKAGE_DIR}/$path/"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE RESULT