diff --git a/functions.sh b/functions.sh index 7322c90..8c09941 100644 --- a/functions.sh +++ b/functions.sh @@ -1,10 +1,10 @@ sit_fail() { - msg=$0 - echo "$msg" - exit 1 + msg="Fail: $1" + echo "$msg" + exit 1 } sit_info() { - msg=$0 + msg=$1 echo $msg } @@ -44,7 +44,7 @@ src_unpack() { sit_unpack() { sit_info "Unpacking sources ..." cd ${WORKDIR} - src_unpack || sit_fail "Unpacking failed" + src_unpack } src_configure() { diff --git a/sit b/sit index 20b00d7..791cb36 100755 --- a/sit +++ b/sit @@ -17,6 +17,7 @@ if [[ -e $SIT_CONFIG_FILE ]] ; then fi source "$SIT_PATH/functions.sh" + # compiler to use # (gnu|intel|pgi) COMPILER=${COMPILER:=gnu} @@ -122,12 +123,12 @@ fi mkdir -p ${WORKDIR} mkdir -p ${BUILDDIR} mkdir -p ${LOGDIR} -sit_unpack 2>&1 | tee "$LOGDIR/unpack.log" -sit_configure 2>&1 | tee "$LOGDIR/configure.log" -sit_build 2>&1 | tee "$LOGDIR/make.log" -sit_pretest 2>&1 | tee "$LOGDIR/pretest.log" -sit_install 2>&1 | tee "$LOGDIR/make_install.log" -sit_posttest 2>&1 | tee "$LOGDIR/posttest.log" +sit_unpack; 2>&1 | tee "$LOGDIR/unpack.log"; ( exit ${PIPESTATUS} ) +sit_configure 2>&1 | tee "$LOGDIR/configure.log"; ( exit ${PIPESTATUS} ) +sit_build 2>&1 | tee "$LOGDIR/make.log"; ( exit ${PIPESTATUS} ) +sit_pretest 2>&1 | tee "$LOGDIR/pretest.log"; ( exit ${PIPESTATUS} ) +sit_install 2>&1 | tee "$LOGDIR/make_install.log"; ( exit ${PIPESTATUS} ) +sit_posttest 2>&1 | tee "$LOGDIR/posttest.log"; ( exit ${PIPESTATUS} ) sit_copy_logs sit_setperms