view tools/rootup.sh @ 421:c685b3c5f40b

Update MPD's Makefile.
author Aleksandr Rybalko <ray@ddteam.net>
date Fri, 14 Sep 2012 02:20:50 +0300
parents b0ce362d3832
children d5a47dc8d6a1
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=`realpath ${SRCPATH}/${ROOTUP}`
	if [ "x${_ROOTUP_TEST}" != "x/" ] ; then
		ROOTUP="${ROOTUP}/.."
	fi
done


echo ${ROOTUP}