improved handling of symlinks;
authorwenzelm
Tue Apr 26 19:49:39 2005 +0200 (2005-04-26)
changeset 15843d5bd4a18ce70
parent 15842 30a4267c6301
child 15844 6b1e5f703246
improved handling of symlinks;
bin/isabelle
bin/isabelle-interface
bin/isabelle-process
bin/isatool
     1.1 --- a/bin/isabelle	Tue Apr 26 17:44:24 2005 +0200
     1.2 +++ b/bin/isabelle	Tue Apr 26 19:49:39 2005 +0200
     1.3 @@ -5,11 +5,12 @@
     1.4  #
     1.5  # Smart selection of isabelle-process versus isabelle-interface.
     1.6  
     1.7 -THIS="$0"
     1.8 -while [ -L "$THIS" ]; do
     1.9 -    THIS="$(dirname "$THIS")/$(LC_ALL=C ls -l "$THIS" | sed 's/.* -> //')"
    1.10 -done
    1.11 -THIS="$(cd "$(dirname "$THIS")"; pwd)"
    1.12 +if [ -L "$0" ]; then
    1.13 +  TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
    1.14 +  exec $(cd "$(dirname "$0")"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET") "$@"
    1.15 +fi
    1.16 +
    1.17 +THIS=$(cd "$(dirname "$0")"; pwd)
    1.18  NAME="$(basename "$0")"
    1.19  
    1.20  case "$NAME" in
     2.1 --- a/bin/isabelle-interface	Tue Apr 26 17:44:24 2005 +0200
     2.2 +++ b/bin/isabelle-interface	Tue Apr 26 19:49:39 2005 +0200
     2.3 @@ -5,16 +5,17 @@
     2.4  #
     2.5  # Isabelle interface startup script.
     2.6  
     2.7 +if [ -L "$0" ]; then
     2.8 +  TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
     2.9 +  exec $(cd "$(dirname "$0")"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET") "$@"
    2.10 +fi
    2.11 +
    2.12  
    2.13  ## settings
    2.14  
    2.15  PRG="$(basename "$0")"
    2.16  
    2.17 -THIS="$0"
    2.18 -while [ -L "$THIS" ]; do
    2.19 -    THIS="$(dirname "$THIS")/$(LC_ALL=C ls -l "$THIS" | sed 's/.* -> //')"
    2.20 -done
    2.21 -ISABELLE_HOME="$(cd "$(dirname "$THIS")/.."; pwd)"
    2.22 +ISABELLE_HOME="$(dirname "$0")/.."
    2.23  . "$ISABELLE_HOME/lib/scripts/getsettings" || \
    2.24    { echo "$PRG probably not called from its original place!"; exit 2; }
    2.25  
     3.1 --- a/bin/isabelle-process	Tue Apr 26 17:44:24 2005 +0200
     3.2 +++ b/bin/isabelle-process	Tue Apr 26 19:49:39 2005 +0200
     3.3 @@ -5,16 +5,17 @@
     3.4  #
     3.5  # Isabelle process startup script.
     3.6  
     3.7 +if [ -L "$0" ]; then
     3.8 +  TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
     3.9 +  exec $(cd "$(dirname "$0")"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET") "$@"
    3.10 +fi
    3.11 +
    3.12  
    3.13  ## settings
    3.14  
    3.15  PRG="$(basename "$0")"
    3.16  
    3.17 -THIS="$0"
    3.18 -while [ -L "$THIS" ]; do
    3.19 -    THIS="$(dirname "$THIS")/$(LC_ALL=C ls -l "$THIS" | sed 's/.* -> //')"
    3.20 -done
    3.21 -ISABELLE_HOME="$(cd "$(dirname "$THIS")/.."; pwd)"
    3.22 +ISABELLE_HOME="$(dirname "$0")/.."
    3.23  . "$ISABELLE_HOME/lib/scripts/getsettings" || \
    3.24    { echo "$PRG probably not called from its original place!"; exit 2; }
    3.25  
     4.1 --- a/bin/isatool	Tue Apr 26 17:44:24 2005 +0200
     4.2 +++ b/bin/isatool	Tue Apr 26 19:49:39 2005 +0200
     4.3 @@ -6,6 +6,11 @@
     4.4  # Isabelle tool starter -- provides settings environment
     4.5  # and keeps your PATH name space clean.
     4.6  
     4.7 +if [ -L "$0" ]; then
     4.8 +  TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
     4.9 +  exec $(cd "$(dirname "$0")"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET") "$@"
    4.10 +fi
    4.11 +
    4.12  
    4.13  ## settings
    4.14