diff options
author | eschnett <eschnett@d47fded2-66c1-406f-af09-4fc0800f9c6b> | 2011-12-15 16:44:06 +0000 |
---|---|---|
committer | eschnett <eschnett@d47fded2-66c1-406f-af09-4fc0800f9c6b> | 2011-12-15 16:44:06 +0000 |
commit | 100a64312c61ac16c974b79b7efd7e6cc40ca53a (patch) | |
tree | 5fcf5b6d54f884042d750ffe8751c42c1d391356 | |
parent | a33ef59f9b8d7e8d12cbba443816539c040d89fa (diff) |
Make output less verbose
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/zlib/trunk@10 d47fded2-66c1-406f-af09-4fc0800f9c6b
-rw-r--r-- | zlib.sh | 59 |
1 files changed, 29 insertions, 30 deletions
@@ -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 @@ -64,39 +66,35 @@ then SRCDIR=$(dirname $0) BUILD_DIR=${SCRATCH_BUILD}/build/${THORN} if [ -z "${ZLIB_INSTALL_DIR}" ]; then - echo "BEGIN MESSAGE" - echo "ZLIB install directory, ZLIB_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 "ZLIB install directory, ZLIB_INSTALL_DIR, selected. Installing ZLIB at ${ZLIB_INSTALL_DIR} " + echo "Installing zlib into ${ZLIB_INSTALL_DIR}" echo "END MESSAGE" - INSTALL_DIR=${ZLIB_INSTALL_DIR} + INSTALL_DIR=${ZLIB_INSTALL_DIR} fi DONE_FILE=${SCRATCH_BUILD}/done/${THORN} ZLIB_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}/zlib.sh ] then - echo "zlib: The enclosed zlib library has already been built; doing nothing" + echo "BEGIN MESSAGE" + echo "zlib has already been built; doing nothing" + echo "END MESSAGE" else - echo "zlib: Building enclosed zlib library" - - # 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) + echo "BEGIN MESSAGE" + echo "Building zlib" + 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 export LDFLAGS @@ -138,14 +136,15 @@ then date > ${DONE_FILE} echo "zlib: Done." - fi -) - - if (( $? )); then - echo 'BEGIN ERROR' - echo 'Error while building zlib. Aborting.' - echo 'END ERROR' - exit 1 + + ) + + if (( $? )); then + echo 'BEGIN ERROR' + echo 'Error while building zlib. Aborting.' + echo 'END ERROR' + exit 1 + fi fi fi |