CTDB's test suite doesn't work from a top-level compile. The first
step to fixing this is to correctly locate the bin/ directory.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
PATH="${_tools_dir}:$PATH"
fi
- _test_bin_dir="${ctdb_dir}/bin"
+ top_dir=$(cd -P "$ctdb_dir" && echo "$PWD") # real path
+
+ _test_bin_dir="${top_dir}/bin"
+ if [ ! -d "$_test_bin_dir" ] ; then
+ top_dir=$(dirname "$top_dir")
+ _test_bin_dir="${top_dir}/bin"
+ fi
fi
-case "$_test_bin_dir" in
-/*) : ;;
-*) _test_bin_dir="${PWD}/${_test_bin_dir}" ;;
-esac
if [ -d "$_test_bin_dir" ] ; then
PATH="${_test_bin_dir}:$PATH"
fi
CTDB_SCRIPTS_SBIN_DIR="${ctdb_dir}/config"
CTDB_SCRIPTS_TOOLS_BIN_DIR="${ctdb_dir}/tools"
CTDB_SCRIPTS_TOOLS_HELPER_DIR="${ctdb_dir}/tools"
- CTDB_SCRIPTS_HELPER_BINDIR="${ctdb_dir}/bin"
+ CTDB_SCRIPTS_HELPER_BINDIR="${top_dir}/bin"
CTDB_SCRIPTS_DATA_DIR="${ctdb_dir}/config"
else
# Installed