From 8a7bf5d33d7ec98366bb906ffc34d20485904c1c Mon Sep 17 00:00:00 2001 From: eschnett Date: Thu, 15 Dec 2011 16:39:58 +0000 Subject: Make output less verbose git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/GSL/trunk@25 9e23cc15-e5c8-4d65-9080-beda90ea645b --- GSL.sh | 57 ++++++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/GSL.sh b/GSL.sh index e19d415..0354017 100644 --- a/GSL.sh +++ b/GSL.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 @@ -16,7 +18,7 @@ set -e # Abort on errors if [ -z "${GSL_DIR}" ]; then echo "BEGIN MESSAGE" - echo "GSL selected, but GSL_DIR not set. Checking some places..." + echo "GSL selected, but GSL_DIR not set. Checking some places..." echo "END MESSAGE" FILES="include/gsl/gsl_math.h" @@ -55,7 +57,7 @@ if [ -z "${GSL_DIR}" \ -o "$(echo "${GSL_DIR}" | tr '[a-z]' '[A-Z]')" = 'BUILD' ] then echo "BEGIN MESSAGE" - echo "Building GSL..." + echo "Using bundled GSL..." echo "END MESSAGE" # Set locations @@ -64,30 +66,35 @@ then SRCDIR=$(dirname $0) BUILD_DIR=${SCRATCH_BUILD}/build/${THORN} if [ -z "${GSL_INSTALL_DIR}" ]; then - echo "BEGIN MESSAGE" - echo "GSL install directory, GSL_INSTALL_DIR, not set. Installing in the default configuration location. " - echo "END MESSAGE" - INSTALL_DIR=${SCRATCH_BUILD}/external/${THORN} + INSTALL_DIR=${SCRATCH_BUILD}/external/${THORN} else echo "BEGIN MESSAGE" - echo "GSL install directory, GSL_INSTALL_DIR, selected. Installing GSL at ${GSL_INSTALL_DIR} " + echo "Installing GSL into ${GSL_INSTALL_DIR} " echo "END MESSAGE" - INSTALL_DIR=${GSL_INSTALL_DIR} + INSTALL_DIR=${GSL_INSTALL_DIR} fi DONE_FILE=${SCRATCH_BUILD}/done/${THORN} GSL_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}/GSL.sh ] then - echo "GSL: The enclosed GSL library has already been built; doing nothing" + echo "BEGIN MESSAGE" + echo "GSL has already been built; doing nothing" + echo "END MESSAGE" else - echo "GSL: Building enclosed GSL library" + echo "BEGIN MESSAGE" + echo "Building GSL" + echo "END MESSAGE" + + # 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 @@ -120,16 +127,16 @@ then date > ${DONE_FILE} echo "GSL: Done." + + ) + if (( $? )); then + echo 'BEGIN ERROR' + echo 'Error while building GSL. Aborting.' + echo 'END ERROR' + exit 1 + fi fi -) - - if (( $? )); then - echo 'BEGIN ERROR' - echo 'Error while building GSL. Aborting.' - echo 'END ERROR' - exit 1 - fi - + fi -- cgit v1.2.3