You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cu...@apache.org on 2006/10/02 20:34:05 UTC
svn commit: r452166 - in /lucene/hadoop/trunk: CHANGES.txt
bin/hadoop-config.sh
Author: cutting
Date: Mon Oct 2 11:34:04 2006
New Revision: 452166
URL: http://svn.apache.org/viewvc?view=rev&rev=452166
Log:
HADOOP-566. Fix scripts to work correctly when accessed through relative symbolic links. Contributed by Lee Faris.
Modified:
lucene/hadoop/trunk/CHANGES.txt
lucene/hadoop/trunk/bin/hadoop-config.sh
Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=452166&r1=452165&r2=452166
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Mon Oct 2 11:34:04 2006
@@ -103,6 +103,9 @@
25. HADOOP-552. Improved error checking when copying map output files
to reduce nodes. (omalley via cutting)
+26. HADOOP-566. Fix scripts to work correctly when accessed through
+ relative symbolic links. (Lee Faris via cutting)
+
Release 0.6.2 - 2006-09-18
Modified: lucene/hadoop/trunk/bin/hadoop-config.sh
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/bin/hadoop-config.sh?view=diff&rev=452166&r1=452165&r2=452166
==============================================================================
--- lucene/hadoop/trunk/bin/hadoop-config.sh (original)
+++ lucene/hadoop/trunk/bin/hadoop-config.sh Mon Oct 2 11:34:04 2006
@@ -3,10 +3,8 @@
# also should not be passed any arguments, since we need original $*
# resolve links - $0 may be a softlink
-bin=`dirname "$0"`
-script=`basename "$0"`
-bin=`cd "$bin"; pwd`
-this="$bin/$script"
+
+this="$0"
while [ -h "$this" ]; do
ls=`ls -ld "$this"`
link=`expr "$ls" : '.*-> \(.*\)$'`
@@ -16,6 +14,12 @@
this=`dirname "$this"`/"$link"
fi
done
+
+# convert relative path to absolute path
+bin=`dirname "$this"`
+script=`basename "$this"`
+bin=`cd "$bin"; pwd`
+this="$bin/$script"
# the root of the Hadoop installation
export HADOOP_HOME=`dirname "$this"`/..