Utilities/Release: Copy pre-built docs tarball to unique name

Name the pre-built docs tarball on the remote machine according to the
release script name so that multiple tarballs going to a single remote
machine do not clobber one another.
This commit is contained in:
Brad King 2014-02-25 13:11:04 -05:00
parent 8619a45336
commit b3d85113a6
2 changed files with 6 additions and 5 deletions

View File

@ -67,14 +67,15 @@ macro(remote_command comment command)
endmacro()
if(CMAKE_DOC_TARBALL)
message("scp '${CMAKE_DOC_TARBALL}' '${HOST}:'")
get_filename_component(CMAKE_DOC_TARBALL_NAME "${CMAKE_DOC_TARBALL}" NAME)
string(REPLACE ".tar.gz" "-${SCRIPT_NAME}.tar.gz" CMAKE_DOC_TARBALL_STAGED "${CMAKE_DOC_TARBALL_NAME}")
message("scp '${CMAKE_DOC_TARBALL}' '${HOST}:${CMAKE_DOC_TARBALL_STAGED}'")
execute_process(COMMAND
scp ${CMAKE_DOC_TARBALL} ${HOST}:
scp ${CMAKE_DOC_TARBALL} ${HOST}:${CMAKE_DOC_TARBALL_STAGED}
RESULT_VARIABLE result)
if(${result} GREATER 0)
message("error sending doc tarball with scp '${CMAKE_DOC_TARBALL}' '${HOST}:'")
message("error sending doc tarball with scp '${CMAKE_DOC_TARBALL}' '${HOST}:${CMAKE_DOC_TARBALL_STAGED}'")
endif()
get_filename_component(CMAKE_DOC_TARBALL_NAME "${CMAKE_DOC_TARBALL}" NAME)
endif()
# set this so configure file will work from script mode

View File

@ -18,7 +18,7 @@ check_exit_value()
CMAKE_DOC_TARBALL=""
if [ ! -z "@CMAKE_DOC_TARBALL_NAME@" ] ; then
CMAKE_DOC_TARBALL=@CMAKE_RELEASE_DIRECTORY@/@CMAKE_DOC_TARBALL_NAME@
mv "$HOME/@CMAKE_DOC_TARBALL_NAME@" "$CMAKE_DOC_TARBALL"
mv "$HOME/@CMAKE_DOC_TARBALL_STAGED@" "$CMAKE_DOC_TARBALL"
check_exit_value $? "mv doc tarball" || exit 1
fi