From f5c7b1712351629bf495c89af06965b03fcdf311 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Wed, 20 Nov 2013 20:01:02 +0100 Subject: [PATCH] sde-build-tools: move strip_wrapper into a separated file and fix bashism Signed-off-by: Alejandro Mery --- bin/sde-build-tools | 18 ++---------------- src/tools-source/strip_wrapper.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 src/tools-source/strip_wrapper.sh diff --git a/bin/sde-build-tools b/bin/sde-build-tools index 79664a3..d21d587 100755 --- a/bin/sde-build-tools +++ b/bin/sde-build-tools @@ -228,22 +228,8 @@ if [ ! -f $TOOLSDIR/.lastupdate ] ; then $( get_reverted `get_expanded target/%/. $targetchain` ) -name 'wrappers.in' ) # echo_status "Building $toolsdir/wrapper/strip_wrapper." - cat << EOT > $TOOLSDIR/wrapper/strip_wrapper.$$ -#!/bin/sh -if [ "\$STRIP_WRAPPER_NOLOOP" = 1 ] ; then - echo "Aaaaaeik! Strip wrapper is looping!" >&2 - exit 1 -fi -if [ "\$SDECFG_DEBUG" = 0 ] ; then - PATH=\${PATH//\$STRIP_WRAPPER_MYPATH:/} - export STRIP_WRAPPER_NOLOOP=1 - exec "\$( basename \$0 )" "\$@" -fi -exit 0 -EOT - chmod +x $TOOLSDIR/wrapper/strip_wrapper.$$ - mv $TOOLSDIR/wrapper/strip_wrapper.$$ \ - $TOOLSDIR/wrapper/strip_wrapper + cp src/tools-source/strip_wrapper.sh $TOOLSDIR/wrapper/strip_wrapper + chmod +x $TOOLSDIR/wrapper/strip_wrapper wrappers="$wrappers strip_wrapper" # for x in strip $arch_target-strip ; do diff --git a/src/tools-source/strip_wrapper.sh b/src/tools-source/strip_wrapper.sh new file mode 100644 index 0000000..69bf673 --- /dev/null +++ b/src/tools-source/strip_wrapper.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: bin/sde-build-tools +# Copyright (C) 2006 - 2013 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# Copyright (C) 1998 - 2003 Clifford Wolf +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ "$STRIP_WRAPPER_NOLOOP" = 1 ] ; then + echo "Aaaaaeik! Strip wrapper is looping!" >&2 + exit 1 +fi +if [ "$SDECFG_DEBUG" = 0 ] ; then + PATH=$(echo $PATH | sed -e "s|$STRIP_WRAPPER_MYPATH:||") + export STRIP_WRAPPER_NOLOOP=1 + exec "$(basename $0)" "$@" +fi +exit 0