Gave up use of PIPESTATUS in releng/run_all_auto because of NetBSD /bin/sh

This commit is contained in:
Thomas Schmitt 2014-03-05 09:21:17 +00:00
parent 1b25f72379
commit 80ed1eba09

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Copyright 2011 George Danchev <danchev@spnet.net> # Copyright 2011 George Danchev <danchev@spnet.net>
# Copyright 2011 Thomas Schmitt <scdbackup@gmx.net> # Copyright 2011 - 2014 Thomas Schmitt <scdbackup@gmx.net>
# Licensed under GNU GPL version 2 or later # Licensed under GNU GPL version 2 or later
set -e set -e
@ -147,17 +147,10 @@ fi
T1=`date '+%s'` T1=`date '+%s'`
set +e set +e
if test -n "$PIPESTATUS" return_wrapper ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG}
then RET=$(cat "$return_value_file")
# PIPESTATUS[0] should be available in bash rm "$return_value_file"
./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG}
RET="${PIPESTATUS[0]}"
else
# a more portable method which uses a temporary file to record exit value
return_wrapper ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG}
RET=$(cat "$return_value_file")
rm "$return_value_file"
fi
# echo "RET='$RET'" >/dev/tty # echo "RET='$RET'" >/dev/tty
T2=`date '+%s'` T2=`date '+%s'`