From c68771a57aed5e1985804b3a2b81d33d17c8bbb4 Mon Sep 17 00:00:00 2001 From: mboelen Date: Mon, 21 Dec 2015 10:03:51 +0100 Subject: [PATCH] Ensure that readlink only is used when it is available --- include/functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/functions b/include/functions index bd91ca14..b16572e8 100644 --- a/include/functions +++ b/include/functions @@ -1608,16 +1608,17 @@ # Ensure that we use a second try with the right tool as well if [ ${SYMLINK_USE_PYTHON} -eq 1 ]; then tFILE=`python -c "import os,sys; print(os.path.realpath(os.path.expanduser(sys.argv[1])))" ${tFILE}` - else + elif [ ${SYMLINK_USE_READLINK} -eq 1 ]; then tFILE=`${READLINKBINARY} -f ${tFILE}` fi + # Check if we now have a normal file if [ -f ${tFILE} ]; then sFILE="${tFILE}" logtext "Result: symlink finally found, seems to be file ${sFILE}" FOUNDPATH=1 elif [ -d ${tFILE} ]; then sFILE="${tFILE}" - logtext "Result: symlink found, seems to be directory ${sFILE}" + logtext "Result: symlink finally found, seems to be directory ${sFILE}" FOUNDPATH=1 else logtext "Result: could not find file ${tFILE}, most likely too complicated symlink or too often linked"