Created
November 28, 2010 15:57
-
-
Save emmanuelbernard/719041 to your computer and use it in GitHub Desktop.
Add support for symlinked bin/*.sh files https://jira.jboss.org/browse/JBAS-8670
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/bin/classpath.sh b/bin/classpath.sh | |
index f4ccf67..8dc77a4 100755 | |
--- a/bin/classpath.sh | |
+++ b/bin/classpath.sh | |
@@ -7,8 +7,12 @@ | |
### $Id: classpath.sh 82920 2009-01-15 17:29:45Z pgier $ ### | |
-DIRNAME=`dirname $0` | |
-PROGNAME=`basename $0` | |
+# Extract the directory and the program name | |
+# takes care of symlinks | |
+PRG=`readlink "$0"` | |
+DIRNAME=`dirname "$PRG"` | |
+PROGNAME=`basename "$PRG"` | |
+ | |
CAT="cat" | |
# | |
diff --git a/bin/password_tool.sh b/bin/password_tool.sh | |
index 43713ca..738f969 100755 | |
--- a/bin/password_tool.sh | |
+++ b/bin/password_tool.sh | |
@@ -4,8 +4,11 @@ | |
# | |
################################ | |
-DIRNAME=`dirname $0` | |
-PROGNAME=`basename $0` | |
+# Extract the directory and the program name | |
+# takes care of symlinks | |
+PRG=`readlink "$0"` | |
+DIRNAME=`dirname "$PRG"` | |
+PROGNAME=`basename "$PRG"` | |
# OS specific support (must be 'true' or 'false'). | |
cygwin=false; | |
diff --git a/bin/probe.sh b/bin/probe.sh | |
index 3198e44..27d7db0 100755 | |
--- a/bin/probe.sh | |
+++ b/bin/probe.sh | |
@@ -8,7 +8,14 @@ | |
# 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=`readlink "$0"` | |
+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; | |
diff --git a/bin/run.sh b/bin/run.sh | |
index 50d4af8..da6be23 100755 | |
--- a/bin/run.sh | |
+++ b/bin/run.sh | |
@@ -7,8 +7,12 @@ | |
### $Id: run.sh 106046 2010-06-15 10:08:41Z [email protected] $ ### | |
-DIRNAME=`dirname $0` | |
-PROGNAME=`basename $0` | |
+# Extract the directory and the program name | |
+# takes care of symlinks | |
+PRG=`readlink "$0"` | |
+DIRNAME=`dirname "$PRG"` | |
+PROGNAME=`basename "$PRG"` | |
+ | |
GREP="grep" | |
# Use the maximum available, or set MAX_FD != -1 to use that | |
diff --git a/bin/shutdown.sh b/bin/shutdown.sh | |
index 8329973..04b9664 100755 | |
--- a/bin/shutdown.sh | |
+++ b/bin/shutdown.sh | |
@@ -7,8 +7,12 @@ | |
### $Id: shutdown.sh 81068 2008-11-14 15:14:35Z [email protected] $ ### | |
-DIRNAME=`dirname $0` | |
-PROGNAME=`basename $0` | |
+# Extract the directory and the program name | |
+# takes care of symlinks | |
+PRG=`readlink "$0"` | |
+DIRNAME=`dirname "$PRG"` | |
+PROGNAME=`basename "$PRG"` | |
+ | |
GREP="grep" | |
# | |
diff --git a/bin/twiddle.sh b/bin/twiddle.sh | |
index ee3b1f6..477e4f1 100755 | |
--- a/bin/twiddle.sh | |
+++ b/bin/twiddle.sh | |
@@ -7,8 +7,12 @@ | |
### $Id: twiddle.sh 63457 2007-06-11 16:33:37Z [email protected] $ ### | |
-DIRNAME=`dirname $0` | |
-PROGNAME=`basename $0` | |
+# Extract the directory and the program name | |
+# takes care of symlinks | |
+PRG=`readlink "$0"` | |
+DIRNAME=`dirname "$PRG"` | |
+PROGNAME=`basename "$PRG"` | |
+ | |
GREP="grep" | |
# | |
diff --git a/bin/wsconsume.sh b/bin/wsconsume.sh | |
index 0f60635..d7fb008 100755 | |
--- a/bin/wsconsume.sh | |
+++ b/bin/wsconsume.sh | |
@@ -1,7 +1,10 @@ | |
#!/bin/sh | |
-DIRNAME=`dirname $0` | |
-PROGNAME=`basename $0` | |
+# Extract the directory and the program name | |
+# takes care of symlinks | |
+PRG=`readlink "$0"` | |
+DIRNAME=`dirname "$PRG"` | |
+PROGNAME=`basename "$PRG"` | |
# OS specific support (must be 'true' or 'false'). | |
cygwin=false; | |
diff --git a/bin/wsprovide.sh b/bin/wsprovide.sh | |
index 7d4eacc..a9a8569 100755 | |
--- a/bin/wsprovide.sh | |
+++ b/bin/wsprovide.sh | |
@@ -1,7 +1,10 @@ | |
#!/bin/sh | |
-DIRNAME=`dirname $0` | |
-PROGNAME=`basename $0` | |
+# Extract the directory and the program name | |
+# takes care of symlinks | |
+PRG=`readlink "$0"` | |
+DIRNAME=`dirname "$PRG"` | |
+PROGNAME=`basename "$PRG"` | |
# OS specific support (must be 'true' or 'false'). | |
cygwin=false; | |
diff --git a/bin/wsrunclient.sh b/bin/wsrunclient.sh | |
index b526be2..451dc48 100755 | |
--- a/bin/wsrunclient.sh | |
+++ b/bin/wsrunclient.sh | |
@@ -1,7 +1,10 @@ | |
#!/bin/sh | |
-DIRNAME=`dirname $0` | |
-PROGNAME=`basename $0` | |
+# Extract the directory and the program name | |
+# takes care of symlinks | |
+PRG=`readlink "$0"` | |
+DIRNAME=`dirname "$PRG"` | |
+PROGNAME=`basename "$PRG"` | |
if [ $# -eq 0 ]; then | |
echo "$PROGNAME is a command line tool that invokes a JBossWS JAX-WS Web Service client." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment