aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@9e23cc15-e5c8-4d65-9080-beda90ea645b>2011-12-15 16:39:58 +0000
committereschnett <eschnett@9e23cc15-e5c8-4d65-9080-beda90ea645b>2011-12-15 16:39:58 +0000
commit8a7bf5d33d7ec98366bb906ffc34d20485904c1c (patch)
tree0262343a9f8acdfe44e4a77ca8fe6bb3149091b4
parent1bcf65471384aecb96117d1d9983517120deeb8e (diff)
Make output less verbose
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/GSL/trunk@25 9e23cc15-e5c8-4d65-9080-beda90ea645b
-rw-r--r--GSL.sh57
1 files 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