Ensure that readlink only is used when it is available

This commit is contained in:
mboelen 2015-12-21 10:03:51 +01:00
parent 259457df8e
commit c68771a57a
1 changed files with 3 additions and 2 deletions

View File

@ -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"