[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] svn-config installedness test fails when symlinked

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-09-10 18:52:12 CEST

Marcus Comstedt <marcus@mc.pp.se> writes:
> -thisdir="`dirname $0`"
> +me="$0"
> +if test -h "$me"; then
> + me="`ls -ld \"\$me\" | sed -ne 's/^.* -> *//p'"
> + if test -z "$me"; then me="$0"; fi
> +fi
> +thisdir="`dirname \"$me\"`"
> thisdir="`cd $thisdir && pwd`"
> if test -d $bindir; then
> tmpbindir="`cd $bindir && pwd`"

Maybe better to abstract to a function that loopingly resolves
symlinks until it reaches the end of the chain? The code above will
only resolve one level of symlink.

(Also, how portable is it to different 'ls' output formats?)

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 10 19:14:23 2002

This is an archived mail posted to the Subversion Dev mailing list.