testing.sh: bashisms are eradicated.

By Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn AT axis.com>
This commit is contained in:
Denis Vlasenko 2008-05-02 09:39:09 +00:00
parent 57be4abcf8
commit 2dea01ca11

View File

@ -79,7 +79,7 @@ testing()
cmp expected actual >/dev/null 2>/dev/null cmp expected actual >/dev/null 2>/dev/null
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
FAILCOUNT=$[$FAILCOUNT+1] FAILCOUNT=$(($FAILCOUNT + 1))
echo "FAIL: $NAME" echo "FAIL: $NAME"
[ -n "$VERBOSE" ] && diff -u expected actual [ -n "$VERBOSE" ] && diff -u expected actual
else else
@ -107,7 +107,8 @@ mkchroot()
shift shift
for i in "$@" for i in "$@"
do do
[ "${i:0:1}" == "/" ] || i=$(which $i) #bashism: [ "${i:0:1}" == "/" ] || i=$(which $i)
i=$(which $i) # no-op for /bin/prog
[ -f "$dest/$i" ] && continue [ -f "$dest/$i" ] && continue
if [ -e "$i" ] if [ -e "$i" ]
then then