changeset 497:7b0ae8e8ab80

Remember about old readlink, which can't do `readlink -f`. Pointed out by: tinderbox
author Aleksandr Rybalko <ray@ddteam.net>
date Tue, 13 Aug 2013 14:11:55 +0300
parents 89304b5a4621
children dc4685acbea3
files tools/rootup.sh
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tools/rootup.sh	Tue Aug 13 12:58:26 2013 +0300
+++ b/tools/rootup.sh	Tue Aug 13 14:11:55 2013 +0300
@@ -2,10 +2,16 @@
 
 SRCPATH=$1
 
+if [ -x /bin/realpath ] ; then
+	REALPATH="realpath"
+else
+	REALPATH="readlink -f"
+fi
+
 ROOTUP="/.."
 _FOR_ROOTUP=`echo ${SRCPATH} | sed 's/\// /g'`
 for r in ${_FOR_ROOTUP}; do
-	_ROOTUP_TEST=`readlink -f ${SRCPATH}/${ROOTUP}`
+	_ROOTUP_TEST=`${REALPATH} ${SRCPATH}/${ROOTUP}`
 	if [ "x${_ROOTUP_TEST}" != "x/" ] ; then
 		ROOTUP="${ROOTUP}/.."
 	fi