ENH: Added support for full remote packaging and copying back to local machine. Added support for uploading to FTP server.

This commit is contained in:
Brad King 2003-01-17 09:52:30 -05:00
parent 911a33ce6d
commit db8552d10d
1 changed files with 59 additions and 7 deletions

View File

@ -53,27 +53,79 @@ error_log()
} }
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
remote() check_host()
{ {
HOST="$1" HOST="$1"
if [ -z "$HOST" ]; then
echo "Must specify host."
return 1
fi
}
#-----------------------------------------------------------------------------
remote()
{
check_host "$1" || return 1
shift shift
REMOTE_TASK="$@" REMOTE_TASK="$@"
echo "------- Running remote task on $HOST. -------" RESULT=0
echo "------- Running remote task on $HOST. -------" &&
(echo "REMOTE=\"1\"" && (echo "REMOTE=\"1\"" &&
echo "TASK=\"${REMOTE_TASK}\"" && echo "TASK=\"${REMOTE_TASK}\"" &&
cat $SELF) | ssh "$HOST" /bin/sh 2>/dev/null cat $SELF) | ssh "$HOST" /bin/sh 2>/dev/null || RESULT=1
echo "-------- Remote task on $HOST done. --------" echo "-------- Remote task on $HOST done. --------" &&
return $RESULT
} }
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
remote_copy() remote_copy()
{ {
HOST="$1" check_host "$1" || return 1
echo "------- Copying tarballs from $HOST. -------" EXPR="$2"
scp "$HOST:${RELEASE_ROOT_NAME}/Tarballs/*" . [ ! -z "$EXPR" ] || EXPR="*"
echo "------- Copying tarballs from $HOST. -------" &&
scp "$HOST:${RELEASE_ROOT_NAME}/Tarballs/${EXPR}" . &&
echo "---- Done copying tarballs from $HOST. -----" echo "---- Done copying tarballs from $HOST. -----"
} }
#-----------------------------------------------------------------------------
remote_copy_source()
{
check_host "$1" || return 1
remote_copy "$HOST" "cmake-${VERSION}.tar*"
}
#-----------------------------------------------------------------------------
remote_copy_binary()
{
check_host "$1" || return 1
remote_copy "$HOST" "cmake-${VERSION}-*"
}
#-----------------------------------------------------------------------------
remote_source()
{
check_host "$1" || return 1
remote "$HOST" source_tarball &&
remote_copy_source "$HOST"
}
#-----------------------------------------------------------------------------
remote_binary()
{
check_host "$1" || return 1
remote "$HOST" binary_tarball &&
remote_copy_binary "$HOST"
}
#-----------------------------------------------------------------------------
upload()
{
echo "------- Copying tarballs to www.cmake.org. -------"
scp cmake-${VERSION}*tar.* www.cmake.org:/projects/FTP/pub/cmake
echo "---- Done copying tarballs to www.cmake.org. -----"
}
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
setup() setup()
{ {