[Zrouter-src] ZRouter.org: push to ZRouter tools/rootup.sh

zrouter-src at zrouter.org zrouter-src at zrouter.org
Tue Aug 13 11:11:06 UTC 2013


details:   http://zrouter.org/hg/zrouter//rev/7b0ae8e8ab80
changeset: 497:7b0ae8e8ab80
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Tue Aug 13 14:11:55 2013 +0300
description:
Remember about old readlink, which can't do `readlink -f`.
Pointed out by:	tinderbox

diffstat:

 tools/rootup.sh |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 89304b5a4621 -r 7b0ae8e8ab80 tools/rootup.sh
--- 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


More information about the Zrouter-src mailing list