summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-07-19 12:15:17 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-07-19 12:15:17 (GMT)
commit709299f2912bfb796b42497f6037a9c9a89f0a8f (patch)
tree8c2580b19b3f3197ef98060f697df0d6109848fe
parente2568395a490f7de3ef9e41dd4b551a6c10e1290 (diff)
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(-)
-rw-r--r--scripts/build/debug/duma.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/build/debug/duma.in b/scripts/build/debug/duma.in
index 7871100..00afd67 100644
--- a/scripts/build/debug/duma.in
+++ b/scripts/build/debug/duma.in
@@ -13,7 +13,18 @@ case "$1" in
shift
;;
-off)
- LD_PRELOAD="${LD_PRELOAD//${LIBDUMA_SO}/}"
+ # We use a suposedly POSIX-compliant shell: /bin/sh
+ # -> we can't use "${LD_PRELOAD//${LIBDUMA_SO}/}", it's not POSIX
+ # We don't know if sed will be present on the target
+ # -> we can't use $(echo "${LD_PRELOAD}" |sed -r -e "s|${LIBDUMA_SO}||;")
+ # So, iterate through LD_PRELOAD, and keep only those libs that
+ # are not "${LIBDUMA_SO}"
+ old_LD_PRELOAD="${LD_PRELOAD}"
+ LD_PRELOAD=
+ for lib in ${old_LD_PRELOAD}; do
+ [ "${lib}" = "${LIBDUMA_SO}" ] || LD_PRELOAD="${LD_PRELOAD} ${lib}"
+ done
+ unset old_LD_PRELOAD
shift
;;
-show)