avoid using realpath, readlink -f is more portable

This commit is contained in:
Tom Scogland 2022-09-27 18:33:52 +00:00
parent 076d60ce35
commit 2cae95334c

View File

@ -11,7 +11,12 @@
#
QA_DIR="$(dirname ${BASH_SOURCE[0]})"
export SPACK_ROOT=$(realpath "$QA_DIR/../../..")
if realpath $QA_DIR >& /dev/null ; then
REALPATH=realpath
else
REALPATH="readlink -f --"
fi
export SPACK_ROOT=$($REALPATH "$QA_DIR/../../..")
# Source the setup script
. "$SPACK_ROOT/share/spack/setup-env.sh"
@ -28,7 +33,7 @@ if [[ "$COVERAGE" == "true" ]]; then
# bash coverage depends on some other factors
mkdir -p coverage
bashcov=$(realpath ${QA_DIR}/bashcov)
bashcov=$($REALPATH ${QA_DIR}/bashcov)
# instrument scripts requiring shell coverage
sed -i "s@#\!/bin/bash@#\!${bashcov}@" "$SPACK_ROOT/lib/spack/env/cc"