[jboss-cvs] JBossAS SVN: r109786 - in trunk: iiop/src/bin and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 8 13:26:02 EST 2010
Author: epbernard
Date: 2010-12-08 13:26:01 -0500 (Wed, 08 Dec 2010)
New Revision: 109786
Modified:
trunk/console/src/bin/twiddle.sh
trunk/iiop/src/bin/runX.sh
trunk/main/src/bin/classpath.sh
trunk/main/src/bin/probe.sh
trunk/main/src/bin/run.sh
trunk/security/src/etc/bin/password_tool.sh
trunk/server/src/bin/shutdown.sh
Log:
JBAS-8670 Add support for symlinked bin/*.sh files\n\nUsing algo used by a few Apache projects
Modified: trunk/console/src/bin/twiddle.sh
===================================================================
--- trunk/console/src/bin/twiddle.sh 2010-12-08 18:07:22 UTC (rev 109785)
+++ trunk/console/src/bin/twiddle.sh 2010-12-08 18:26:01 UTC (rev 109786)
@@ -7,8 +7,21 @@
### $Id$ ###
-DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
+# Extract the directory and the program name
+# takes care of symlinks
+PRG="$0"
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+DIRNAME=`dirname "$PRG"`
+PROGNAME=`basename "$PRG"`
+
GREP="grep"
#
Modified: trunk/iiop/src/bin/runX.sh
===================================================================
--- trunk/iiop/src/bin/runX.sh 2010-12-08 18:07:22 UTC (rev 109785)
+++ trunk/iiop/src/bin/runX.sh 2010-12-08 18:26:01 UTC (rev 109786)
@@ -7,8 +7,20 @@
### $Id$ ###
-DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
+# Extract the directory and the program name
+# takes care of symlinks
+PRG="$0"
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+DIRNAME=`dirname "$PRG"`
+PROGNAME=`basename "$PRG"`
GREP="grep"
#
Modified: trunk/main/src/bin/classpath.sh
===================================================================
--- trunk/main/src/bin/classpath.sh 2010-12-08 18:07:22 UTC (rev 109785)
+++ trunk/main/src/bin/classpath.sh 2010-12-08 18:26:01 UTC (rev 109786)
@@ -7,8 +7,21 @@
### $Id$ ###
-DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
+# Extract the directory and the program name
+# takes care of symlinks
+PRG="$0"
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+DIRNAME=`dirname "$PRG"`
+PROGNAME=`basename "$PRG"`
+
CAT="cat"
#
Modified: trunk/main/src/bin/probe.sh
===================================================================
--- trunk/main/src/bin/probe.sh 2010-12-08 18:07:22 UTC (rev 109785)
+++ trunk/main/src/bin/probe.sh 2010-12-08 18:26:01 UTC (rev 109786)
@@ -8,8 +8,24 @@
# Discovers all UDP-based members running on a certain mcast address (use -help for help)
# Probe [-help] [-addr <addr>] [-port <port>] [-ttl <ttl>] [-timeout <timeout>]
-CLASSPATH=.:../lib/commons-logging.jar:../server/all/lib/jgroups.jar:$CLASSPATH
+# Extract the directory and the program name
+# takes care of symlinks
+PRG="$0"
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+DIRNAME=`dirname "$PRG"`
+PROGNAME=`basename "$PRG"`
+
+CLASSPATH=.:$DIRNAME/../lib/commons-logging.jar:$DIRNAME/../server/all/lib/jgroups.jar:$CLASSPATH
+
# OS specific support (must be 'true' or 'false').
cygwin=false;
case "`uname`" in
Modified: trunk/main/src/bin/run.sh
===================================================================
--- trunk/main/src/bin/run.sh 2010-12-08 18:07:22 UTC (rev 109785)
+++ trunk/main/src/bin/run.sh 2010-12-08 18:26:01 UTC (rev 109786)
@@ -7,8 +7,21 @@
### $Id$ ###
-DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
+# Extract the directory and the program name
+# takes care of symlinks
+PRG="$0"
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+DIRNAME=`dirname "$PRG"`
+PROGNAME=`basename "$PRG"`
+
GREP="grep"
# Use the maximum available, or set MAX_FD != -1 to use that
Modified: trunk/security/src/etc/bin/password_tool.sh
===================================================================
--- trunk/security/src/etc/bin/password_tool.sh 2010-12-08 18:07:22 UTC (rev 109785)
+++ trunk/security/src/etc/bin/password_tool.sh 2010-12-08 18:26:01 UTC (rev 109786)
@@ -4,8 +4,20 @@
#
################################
-DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
+# Extract the directory and the program name
+# takes care of symlinks
+PRG="$0"
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+DIRNAME=`dirname "$PRG"`
+PROGNAME=`basename "$PRG"`
# OS specific support (must be 'true' or 'false').
cygwin=false;
Modified: trunk/server/src/bin/shutdown.sh
===================================================================
--- trunk/server/src/bin/shutdown.sh 2010-12-08 18:07:22 UTC (rev 109785)
+++ trunk/server/src/bin/shutdown.sh 2010-12-08 18:26:01 UTC (rev 109786)
@@ -7,8 +7,21 @@
### $Id$ ###
-DIRNAME=`dirname $0`
-PROGNAME=`basename $0`
+# Extract the directory and the program name
+# takes care of symlinks
+PRG="$0"
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+done
+DIRNAME=`dirname "$PRG"`
+PROGNAME=`basename "$PRG"`
+
GREP="grep"
#
More information about the jboss-cvs-commits
mailing list