From 5fc332ae4b723a39cffca9386bc40a3a5398924e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Wed, 6 Apr 2022 00:15:45 +0200 Subject: [PATCH] Makefile: zfs-tests lives in srcdir; zfs-tests: accept common.sh path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes out-of-tree builds Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13316 --- Makefile.am | 3 +-- scripts/zfs-tests.sh | 9 ++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index acfd83bec..81b3e69eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,8 +75,7 @@ distclean-local:: -type f -delete all-local: - -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \ - ${top_builddir}/scripts/zfs-tests.sh -c + -SCRIPT_COMMON=$(top_builddir)/scripts/common.sh $(top_srcdir)/scripts/zfs-tests.sh -c dist-hook: $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh -D $(distdir) $(GITREV) diff --git a/scripts/zfs-tests.sh b/scripts/zfs-tests.sh index e7d04110e..df69325a1 100755 --- a/scripts/zfs-tests.sh +++ b/scripts/zfs-tests.sh @@ -26,13 +26,8 @@ # Copyright 2020 OmniOS Community Edition (OmniOSce) Association. # -BASE_DIR=$(dirname "$0") -SCRIPT_COMMON=common.sh -if [ -f "${BASE_DIR}/${SCRIPT_COMMON}" ]; then - . "${BASE_DIR}/${SCRIPT_COMMON}" -else - echo "Missing helper script ${SCRIPT_COMMON}" && exit 1 -fi +SCRIPT_COMMON=${SCRIPT_COMMON:-${0%/*}/common.sh} +. "${SCRIPT_COMMON}" || exit PROG=zfs-tests.sh VERBOSE="no"