scripts/wrapper.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Dec 14 19:17:37 2009 +0100 (2009-12-14)
changeset 1662 ea3490d46f4e
parent 1402 146c62142e1b
child 1960 8307ceabe5c0
permissions -rw-r--r--
scripts: correctly warn when the local tarballs directory does not exist

Warn about a missing local tarball directory, only if it was configured.
Avoid the spurious message:
Directory '${CT_LOCAL_TARBALLS_DIR}' does not exist.
Will not save downloaded tarballs to local storage.

Thanks to "Pedro I. Sanchez" <psanchez@colcan.ca> for pointing out the
issue:
http://sourceware.org/ml/crossgcc/2009-12/msg00011.html
     1 #!/bin/sh
     2 
     3 canonicalizedname=$(readlink -nm "${0}")
     4 dirname="$(dirname "${canonicalizedname}")"
     5 basename="$(basename "${canonicalizedname}")"
     6 
     7 ld_lib_path="$(dirname "${dirname}")/lib"
     8 
     9 case ":${LD_LIBRARY_PATH}:" in
    10     *":${ld_lib_path}:"*)   ;;
    11     *)  LD_LIBRARY_PATH="${ld_lib_path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}";;
    12 esac
    13 
    14 export LD_LIBRARY_PATH
    15 exec "${dirname}/.${basename}" "$@"