Resolve symlinks before trying to recognize a lisp implementation

The CCL package installs a symlink named "ccl" that points at the
actual implementation executable: lx86cl64 (or lx86cl for 32 bit).
When clwrapper is used with CCL as the backing implementation, this
script fails to recognize the implementation.  By resolving the
symlink, we are able to recognize which implementation we're actually
working with.
This commit is contained in:
Brad Jensen 2019-07-24 09:21:04 -07:00
parent 6b7c72105e
commit fa7bd53d0d

View File

@ -8,7 +8,12 @@ eval "$NIX_LISP_PREHOOK"
NIX_LISP_COMMAND="$1"
shift
[ -z "$NIX_LISP" ] && NIX_LISP="${NIX_LISP_COMMAND##*/}"
if [ -z "$NIX_LISP" ]; then
while [ -h "${NIX_LISP_COMMAND}" ]; do
NIX_LISP_COMMAND="$(readlink -n "${NIX_LISP_COMMAND}")"
done
NIX_LISP="${NIX_LISP_COMMAND##*/}"
fi
export NIX_LISP NIX_LISP_LOAD_FILE NIX_LISP_EXEC_CODE NIX_LISP_COMMAND NIX_LISP_FINAL_PARAMETERS