testprogs: Use system_or_builddir_binary() for dbcheck-oldrelease
authorAndreas Schneider <asn@samba.org>
Thu, 22 Dec 2022 12:03:13 +0000 (13:03 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 23 Dec 2022 14:35:31 +0000 (14:35 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
testprogs/blackbox/dbcheck-oldrelease.sh

index 635ada9414c4a4412c36b6588c3189e81b4146e3..afd2d1247ceb92538e6b53fdd6fd9676555c393a 100755 (executable)
@@ -18,25 +18,12 @@ failed=0
 
 release_dir=$(dirname $0)/../../source4/selftest/provisions/$RELEASE
 
-ldbmodify="ldbmodify"
-if [ -x "$BINDIR/ldbmodify" ]; then
-       ldbmodify="$BINDIR/ldbmodify"
-fi
-
-ldbdel="ldbdel"
-if [ -x "$BINDIR/ldbdel" ]; then
-       ldbdel="$BINDIR/ldbdel"
-fi
-
-ldbsearch="ldbsearch"
-if [ -x "$BINDIR/ldbsearch" ]; then
-       ldbsearch="$BINDIR/ldbsearch"
-fi
-
-samba_tdbrestore="tdbrestore"
-if [ -x "$BINDIR/tdbrestore" ]; then
-       samba_tdbrestore="$BINDIR/tdbrestore"
-fi
+ldbadd=$(system_or_builddir_binary ldbadd "${BINDIR}")
+ldbmodify=$(system_or_builddir_binary ldbmodify "${BINDIR}")
+ldbdel=$(system_or_builddir_binary ldbdel "${BINDIR}")
+ldbsearch=$(system_or_builddir_binary ldbsearch "${BINDIR}")
+ldbrename=$(system_or_builddir_binary ldbrename "${BINDIR}")
+samba_tdbrestore=$(system_or_builddir_binary tdbrestore "${BINDIR}")
 
 samba_undump="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
 if [ ! -x $samba_undump ] || [ ! -d $release_dir ]; then