From: Jan-Benedict G. <jb...@us...> - 2005-05-22 15:32:48
|
Update of /cvsroot/linux-vax/toolchain/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4598 Modified Files: build_toolchain.sh Log Message: - Allow to restart an operation /n/ times. Helpful for cvs update -D because the CVS servers will just drop connections if a given load is reached. Try again later, in the hope that the tagging/merging operation has finished. Index: build_toolchain.sh =================================================================== RCS file: /cvsroot/linux-vax/toolchain/scripts/build_toolchain.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- build_toolchain.sh 11 May 2005 19:29:33 -0000 1.6 +++ build_toolchain.sh 22 May 2005 15:32:37 -0000 1.7 @@ -205,21 +205,41 @@ # function execute() { local RETVAL + local RESTART_LOOP + local RESTART_MAX - echo "#" - echo "#" - echo "# Executing in `pwd`:" - echo "# $*" - echo "#" - echo "#" + RESTART_LOOP=1 + RESTART_MAX=1 + if [ "$1" = --restart ]; then + RESTART_MAX="$2" + shift 2 + fi - "$@" - RETVAL=$? + while [ "${RESTART_LOOP}" -le "${RESTART_MAX}" ]; do + echo "#" + echo "#" + echo "# Executing in `pwd` (run ${RESTART_LOOP}/${RESTART_MAX}):" + echo "# $*" + echo "#" + echo "#" - echo "#" - echo "# End of: $*" - echo "#" - echo + set +e + "$@" + RETVAL=$? + set -e + + echo "#" + echo "# End of: $*" + echo "#" + echo + + if [ "${RETVAL}" -eq 0 ]; then + return "${RETVAL}" + fi + + RESTART_LOOP=$(( ${RESTART_LOOP} + 1 )) + sleep 20 + done return "${RETVAL}" } @@ -303,17 +323,17 @@ # if [ "${DO_TIMESTAMP_BINUTILS}" -ne 0 ]; then pushd "${BINUTILS_SRC}" - execute cvs -z9 update -d -P -D "${TIMESTAMP_BINUTILS}" + execute --restart 6 cvs -z9 update -d -P -D "${TIMESTAMP_BINUTILS}" popd fi if [ "${DO_TIMESTAMP_GCC}" -ne 0 ]; then pushd "${GCC_SRC}" - execute cvs -z9 update -d -P -D "${TIMESTAMP_GCC}" + execute --restart 6 cvs -z9 update -d -P -D "${TIMESTAMP_GCC}" popd fi if [ "${DO_TIMESTAMP_GLIBC}" -ne 0 ]; then pushd "${GLIBC_SRC}" - execute cvs -z9 update -d -P -D "${TIMESTAMP_GLIBC}" + execute --restart 6 cvs -z9 update -d -P -D "${TIMESTAMP_GLIBC}" popd fi # |