view tools/rootup.sh @ 495:d5a47dc8d6a1

Replace `realpath` with `readlink -f` so ZRouter.org can build on OpenBSD. Pointed by: Paul Irofti
author Aleksandr Rybalko <ray@ddteam.net>
date Tue, 13 Aug 2013 12:50:43 +0300
parents b0ce362d3832
children 7b0ae8e8ab80
line wrap: on
line source
#!/bin/sh

SRCPATH=$1

ROOTUP="/.."
_FOR_ROOTUP=`echo ${SRCPATH} | sed 's/\// /g'`
for r in ${_FOR_ROOTUP}; do
	_ROOTUP_TEST=`readlink -f ${SRCPATH}/${ROOTUP}`
	if [ "x${_ROOTUP_TEST}" != "x/" ] ; then
		ROOTUP="${ROOTUP}/.."
	fi
done


echo ${ROOTUP}