Commit f991114c authored by Pere Mato Vila's avatar Pere Mato Vila
Browse files

Changed the way to set a file lock to update concurrently buuild summary

parent 69992571
Pipeline #1284347 passed with stage
in 5 minutes and 10 seconds
......@@ -290,10 +290,12 @@ macro(LCGPackage_Add name)
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/timestamps/${targetname}-start.timestamp
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/timestamps/${targetname}-stop.timestamp
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/${tarname}
COMMAND ${LOCKFILE} -l 1200 ${CMAKE_BINARY_DIR}/summary.lock
COMMAND ${CMAKE_COMMAND} -DNAME=${name}
-DSUMFILE=${CMAKE_BINARY_DIR}/LCG_${LCG_VERSION}_${LCG_system}.txt
-DINSTALLDIR=${CMAKE_INSTALL_PREFIX}/${install_path}
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/UpdateSummaryFile.cmake
COMMAND ${LOCKFILE} --unlock ${CMAKE_BINARY_DIR}/summary.lock
COMMENT "${targetname} binary already existing in ${tarurl}. Downloading and installing it.")
#---Do not have the buildinfo from the binary package
set(${targetname}_buildinfo "# PLACEHOLDER for package ${name}")
......
......@@ -15,7 +15,6 @@ if(EXISTS ${INSTALLDIR}/.buildinfo_${NAME}.txt)
if(NOT ${buildinfo} MATCHES "DIRECTORY:")
string(REPLACE "VERSION:" "DIRECTORY: ${NAME}, VERSION:" buildinfo ${buildinfo})
endif()
file(LOCK lock_summary.cmake TIMEOUT 10)
file(READ ${SUMFILE} summary)
while(NOT summary)
message("retrying to update summary for ${NAME} ...")
......@@ -23,7 +22,7 @@ if(EXISTS ${INSTALLDIR}/.buildinfo_${NAME}.txt)
endwhile()
string(REPLACE "# PLACEHOLDER for package ${NAME}" "${buildinfo}" summary "${summary}")
file(WRITE ${SUMFILE} ${summary})
file(LOCK lock_summary.cmake RELEASE)
message("==== Updated ${SUMFILE} with .buildinfo_${NAME}.txt")
else()
message("==== .buildinfo_${NAME}.txt file not found")
endif()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment