From cb168b365c7778e17fa66b1ead251b26b8acada4 Mon Sep 17 00:00:00 2001 From: eschnett Date: Thu, 15 Dec 2011 16:41:09 +0000 Subject: Make output less verbose git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/LORENE/trunk@34 5c1b1641-b641-47ec-b3d9-0f93d4c445ee --- LORENE.sh | 59 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/LORENE.sh b/LORENE.sh index 5b0ca21..d8bdc9f 100644 --- a/LORENE.sh +++ b/LORENE.sh @@ -5,7 +5,9 @@ ################################################################################ # Set up shell -set -x # Output commands +if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then + set -x # Output commands +fi set -e # Abort on errors @@ -34,7 +36,7 @@ if [ -z "${LORENE_DIR}" \ -o "$(echo "${LORENE_DIR}" | tr '[a-z]' '[A-Z]')" = 'BUILD' ] then echo "BEGIN MESSAGE" - echo "Building LORENE..." + echo "Using bundled LORENE..." echo "END MESSAGE" # Set locations @@ -43,39 +45,35 @@ then SRCDIR=$(dirname $0) BUILD_DIR=${SCRATCH_BUILD}/build/${THORN} if [ -z "${LORENE_INSTALL_DIR}" ]; then - echo "BEGIN MESSAGE" - echo "LORENE install directory LORENE_INSTALL_DIR not set. Installing in the default configuration location." - echo "END MESSAGE" INSTALL_DIR=${SCRATCH_BUILD}/external/${THORN} else echo "BEGIN MESSAGE" - echo "LORENE install directory LORENE_INSTALL_DIR set. Installing LORENE at ${LORENE_INSTALL_DIR}." + echo "Installing LORENE into ${LORENE_INSTALL_DIR}" echo "END MESSAGE" INSTALL_DIR=${LORENE_INSTALL_DIR} fi DONE_FILE=${SCRATCH_BUILD}/done/${THORN} LORENE_DIR=${INSTALL_DIR} -( - exec >&2 # Redirect stdout to stderr - set -x # Output commands - set -e # Abort on errors - cd ${SCRATCH_BUILD} if [ -e ${DONE_FILE} -a ${DONE_FILE} -nt ${SRCDIR}/dist/${NAME}.tar.gz \ -a ${DONE_FILE} -nt ${SRCDIR}/LORENE.sh ] then - echo "LORENE: The enclosed LORENE library has already been built; doing nothing" + echo "BEGIN MESSAGE" + echo "LORENE has already been built; doing nothing" + echo "END MESSAGE" else - echo "LORENE: Building enclosed LORENE library" + echo "BEGIN MESSAGE" + echo "Building LORENE" + echo "END MESSAGE" - # Should we use gmake or make? - MAKE=$(gmake --help > /dev/null 2>&1 && echo gmake || echo make) - # Should we use gtar or tar? - TAR=$(gtar --help > /dev/null 2> /dev/null && echo gtar || echo tar) - # Should we use gpatch or patch? - if [ -z "$PATCH" ]; then - PATCH=$(gpatch -v > /dev/null 2>&1 && echo gpatch || echo patch) + # Build in a subshell + ( + exec >&2 # Redirect stdout to stderr + if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then + set -x # Output commands fi + set -e # Abort on errors + cd ${SCRATCH_BUILD} # Set up environment unset LIBS @@ -128,8 +126,8 @@ then export HOME_LORENE=${BUILD_DIR}/${NAME} cat > local_settings < ${DONE_FILE} echo "LORENE: Done." - fi -) - - if (( $? )); then - echo 'BEGIN ERROR' - echo 'Error while building LORENE. Aborting.' - echo 'END ERROR' - exit 1 + + ) + + if (( $? )); then + echo 'BEGIN ERROR' + echo 'Error while building LORENE. Aborting.' + echo 'END ERROR' + exit 1 + fi fi fi -- cgit v1.2.3