You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2005/10/03 02:16:41 UTC

svn commit: r293186 - /maven/components/trunk/maven-core/src/bin/m2

Author: brett
Date: Sun Oct  2 17:16:36 2005
New Revision: 293186

URL: http://svn.apache.org/viewcvs?rev=293186&view=rev
Log:
PR: MNG-247
Submitted by: Jerome Lacoste
Reviewed by:  Brett Porter
make m2 shell script find home when it is a symlink

Modified:
    maven/components/trunk/maven-core/src/bin/m2

Modified: maven/components/trunk/maven-core/src/bin/m2
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/bin/m2?rev=293186&r1=293185&r2=293186&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/bin/m2 (original)
+++ maven/components/trunk/maven-core/src/bin/m2 Sun Oct  2 17:16:36 2005
@@ -55,28 +55,27 @@
 
   ## resolve links - $0 may be a link to maven's home
   PRG="$0"
-  saveddir=`pwd`
 
   # need this for relative symlinks
-  PRGDIR=`dirname "$PRG"`
-  cd "$PRGDIR"
-
   while [ -h "$PRG" ] ; do
     ls=`ls -ld "$PRG"`
     link=`expr "$ls" : '.*-> \(.*\)$'`
     if expr "$link" : '.*/.*' > /dev/null; then
-  PRG="$link"
+      PRG="$link"
     else
-  PRG="$PRGDIR/$link"
+      PRG="`dirname "$PRG"`/$link"
     fi
   done
 
-  M2_HOME="$PRGDIR/.."
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
 
   # make it fully qualified
   M2_HOME=`cd "$M2_HOME" && pwd`
 
   cd "$saveddir"
+  # echo Using m2 at $M2_HOME
 fi
 
 # For Cygwin, ensure paths are in UNIX format before anything is touched



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org