[jboss-jira] [JBoss JIRA] Created: (JBAS-8670) Add support for symlinked bin/*.sh files
Emmanuel Bernard (JIRA)
jira-events at lists.jboss.org
Sun Nov 28 10:39:30 EST 2010
Add support for symlinked bin/*.sh files
----------------------------------------
Key: JBAS-8670
URL: https://jira.jboss.org/browse/JBAS-8670
Project: JBoss Application Server
Issue Type: Patch
Security Level: Public (Everyone can see)
Affects Versions: 6.0.0.CR1
Reporter: Emmanuel Bernard
Assignee: Emmanuel Bernard
Priority: Minor
Attachments: JBAS-8670-symlink.patch
I was working on packagin JBoss AS into homebrew (Mac OS packaging system) and found a limitation in our command scripts.
They assume that the script has not been symlinked and hence fail to find the right jars upon symlinked scripts.
Basically, they do
{code}
DIRNAME=`dirname $0`
PROGNAME=`basename $0`
{code}
and should do
{code}
# 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"`
{code}
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list