Bugfix: Fixing problems with return values.

This commit is contained in:
Christoph Niethammer 2011-03-03 13:07:56 +00:00
parent 5a761c9cc7
commit 0b648f89d4
2 changed files with 12 additions and 11 deletions

View file

@ -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() {

13
sit
View file

@ -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