Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8670

Add support for symlinked bin/*.sh files

    XMLWordPrintable

Details

    • Patch
    • Resolution: Done
    • Minor
    • 6.0.0.Final
    • 6.0.0.CR1
    • None
    • Low

    Description

      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

      DIRNAME=`dirname $0`
      PROGNAME=`basename $0`
      

      and should do

      # 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"`
      

      Attachments

        Activity

          People

            rhn-engineering-ebernard Emmanuel Bernard
            rhn-engineering-ebernard Emmanuel Bernard
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: