Changeset 11621 for trunk/source/scripts


Ignore:
Timestamp:
Jan 16, 2009, 5:13:15 AM (11 years ago)
Author:
rme
Message:

Make ccl and ccl64 scripts look at $0, resolve symlinks if any, and
use this path to determine the value of CCL_DEFAULT_DIRECTORY (if not
otherwise set).

(Patch from Tobias C. Rittweiler)

See ticket:398.

Location:
trunk/source/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/scripts/ccl

    r11404 r11621  
    66# takes precedence over definitions made below.
    77
     8probe()
     9{
     10    if [ -e "$1"  -a  -e "$1/scripts/ccl" ]; then
     11        CCL_DEFAULT_DIRECTORY="$1"
     12    fi
     13}
     14
     15if [ -z "$CCL_DEFAULT_DIRECTORY"  -a  -n "`which readlink`" ]; then
     16    dir="`readlink $0`"
     17    probe "${dir%/scripts/ccl}"
     18fi
     19
    820if [ -z "$CCL_DEFAULT_DIRECTORY" ]; then
    9   CCL_DEFAULT_DIRECTORY=/usr/local/src/ccl
     21    probe "/usr/local/src/ccl"
     22fi
     23
     24if [ -z "$CCL_DEFAULT_DIRECTORY" ]; then
     25    echo "Can't find CCL directory.  Please edit $0 or"
     26    echo "set the environment variable CCL_DEFAULT_DIRECTORY"
     27    echo "and try again."
     28    exit 1
    1029fi
    1130
  • trunk/source/scripts/ccl64

    r10504 r11621  
    66# takes precedence over definitions made below.
    77
     8probe()
     9{
     10    if [ -e "$1"  -a  -e "$1/scripts/ccl64" ]; then
     11        CCL_DEFAULT_DIRECTORY="$1"
     12    fi
     13}
     14
     15if [ -z "$CCL_DEFAULT_DIRECTORY"  -a  -n "`which readlink`" ]; then
     16    dir="`readlink $0`"
     17    probe "${dir%/scripts/ccl64}"
     18fi
     19
    820if [ -z "$CCL_DEFAULT_DIRECTORY" ]; then
    9   CCL_DEFAULT_DIRECTORY=/usr/local/src/ccl
     21    probe "/usr/local/src/ccl"
     22fi
     23
     24if [ -z "$CCL_DEFAULT_DIRECTORY" ]; then
     25    echo "Can't find CCL directory.  Please edit $0 or"
     26    echo "set the environment variable CCL_DEFAULT_DIRECTORY"
     27    echo "and try again."
     28    exit 1
    1029fi
    1130
Note: See TracChangeset for help on using the changeset viewer.