From 74e4f9051fd3bfde0bd63448fd89468c24a50a2a Mon Sep 17 00:00:00 2001 From: Rein Tollevik Date: Tue, 18 Nov 2008 22:16:42 +0000 Subject: [PATCH] Only use a db_stat in PATH if it matches our environment. --- tests/scripts/test053-syncprov-glue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/scripts/test053-syncprov-glue b/tests/scripts/test053-syncprov-glue index 0a4d70d110..429b17becf 100755 --- a/tests/scripts/test053-syncprov-glue +++ b/tests/scripts/test053-syncprov-glue @@ -476,12 +476,20 @@ if test $RC != 0 ; then exit $RC fi -type db_stat >/dev/null 2>&1 -RC=$? -if test $RC != 0 ; then - echo "Could not find db_stat ($RC)!" +db_stat= +for path in `echo "$PATH" | sed -e 's/:/ /g'`; do + if test -f "$path/db_stat" && \ + "$path/db_stat" -E -h $PRODDIR/db > /dev/null 2>&1 + then + db_stat="$path/db_stat" + break + fi +done + +if test -z "$db_stat" ; then + echo "Could not find a working db_stat in PATH!" lock_bug=1 -elif db_stat -E -h $PRODDIR/db | egrep -q 'HELD .* len:'; then +elif "$db_stat" -E -h $PRODDIR/db | egrep -q 'HELD .* len:'; then echo "WARNING: Glue lock bug hit, next modify could deadlock" lock_bug=2 else -- 2.39.5