Use POSIX constructs in the DUMA wrapper installed on the target.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 19 12:15:17 2008 +0000 (2008-07-19)
changeset 686dd364fef67b4
parent 685 1ac394031fd8
child 687 b2b6b1d46aa1
Use POSIX constructs in the DUMA wrapper installed on the target.

/trunk/scripts/build/debug/duma.in | 13 12 1 0 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
scripts/build/debug/duma.in
     1.1 --- a/scripts/build/debug/duma.in	Sat Jul 19 10:51:42 2008 +0000
     1.2 +++ b/scripts/build/debug/duma.in	Sat Jul 19 12:15:17 2008 +0000
     1.3 @@ -13,7 +13,18 @@
     1.4      shift
     1.5      ;;
     1.6    -off)
     1.7 -    LD_PRELOAD="${LD_PRELOAD//${LIBDUMA_SO}/}"
     1.8 +    # We use a suposedly POSIX-compliant shell: /bin/sh
     1.9 +    #  -> we can't use "${LD_PRELOAD//${LIBDUMA_SO}/}", it's not POSIX
    1.10 +    # We don't know if sed will be present on the target
    1.11 +    #  -> we can't use $(echo "${LD_PRELOAD}" |sed -r -e "s|${LIBDUMA_SO}||;")
    1.12 +    # So, iterate through LD_PRELOAD, and keep only those libs that
    1.13 +    # are not "${LIBDUMA_SO}"
    1.14 +    old_LD_PRELOAD="${LD_PRELOAD}"
    1.15 +    LD_PRELOAD=
    1.16 +    for lib in ${old_LD_PRELOAD}; do
    1.17 +      [ "${lib}" = "${LIBDUMA_SO}" ] || LD_PRELOAD="${LD_PRELOAD} ${lib}"
    1.18 +    done
    1.19 +    unset old_LD_PRELOAD
    1.20      shift
    1.21      ;;
    1.22    -show)