Author: asavu
Date: Mon Feb 20 21:47:36 2012
New Revision: 1291464
URL: http://svn.apache.org/viewvc?rev=1291464&view=rev
Log:
WHIRR-507. Make whirr script executable from any path (Marco Didonna via asavu)
Modified:
whirr/branches/branch-0.7/CHANGES.txt
whirr/branches/branch-0.7/bin/whirr
Modified: whirr/branches/branch-0.7/CHANGES.txt
URL:
http://svn.apache.org/viewvc/whirr/branches/branch-0.7/CHANGES.txt?rev=1291464&r1=1291463&r2=1291464&view=diff
==============================================================================
--- whirr/branches/branch-0.7/CHANGES.txt (original)
+++ whirr/branches/branch-0.7/CHANGES.txt Mon Feb 20 21:47:36 2012
@@ -4,6 +4,9 @@ Release 0.7.1
IMPROVEMENTS
+ WHIRR-507. Make whirr script executable from any path
+ (Marco Didonna via asavu)
+
BUG FIXES
WHIRR-502. configure_cdh_hadoop.sh: syntax error trying to
Modified: whirr/branches/branch-0.7/bin/whirr
URL:
http://svn.apache.org/viewvc/whirr/branches/branch-0.7/bin/whirr?rev=1291464&r1=1291463&r2=1291464&view=diff
==============================================================================
--- whirr/branches/branch-0.7/bin/whirr (original)
+++ whirr/branches/branch-0.7/bin/whirr Mon Feb 20 21:47:36 2012
@@ -15,7 +15,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-BIN=$(cd $(dirname "$0"); pwd)
+SOURCE=$0;
+SCRIPT=`basename "$SOURCE"`;
+while [ -h "$SOURCE" ]; do
+ SCRIPT=`basename "$SOURCE"`;
+ LOOKUP=`ls -ld "$SOURCE"`;
+ TARGET=`expr "$LOOKUP" : '.*-> \(.*\)$'`;
+ if expr "${TARGET:-.}/" : '/.*/$' > /dev/null; then
+ SOURCE=${TARGET:-.};
+ else
+ SOURCE=`dirname "$SOURCE"`/${TARGET:-.};
+ fi;
+done;
+
+BIN=$(cd $(dirname "$SOURCE"); pwd)
LOGGING_OPTS="-Dlog4j.configuration=log4j-cli.xml"
if [ -d "$BIN/../cli/target/lib" ]; then