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

[PATCH] svn-config installedness test fails when symlinked

From: Marcus Comstedt <marcus_at_mc.pp.se>
Date: 2002-09-10 18:35:49 CEST

In svn-config, there is code that tries to detect whether subversion
has been installed yet by looking at `basename $0`. Unfortunately,
this will not work if you invoke svn-config through a symlink, since
you'll get the path of the directory containing the symlink rather
than that actually containing the script. Thus the test fails, and
you get bogus values from svn-config.

The best solution would probably be to modify the script when
installing it, so that location= is always hard-coded rather than
probed, but I can't figure out the stupid gen-pike.py script so
I don't know where to add the appropriate sed command...

If someone points me to where to do it, I can make a better patch. In
the meantime, here's one that simply causes svn-config to follow the
symlink, thus allowing it to accurately determine which directory its
being run from.

Index: svn-config.in
===================================================================
--- svn-config.in
+++ svn-config.in Tue Sep 10 17:54:05 2002
@@ -63,7 +63,12 @@
     exit 1
 fi
 
-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`"

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 10 18:37:22 2002

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.