--- trunk/mage/usr/lib/mage/smage2.sh 2011/12/28 10:51:52 1577 +++ trunk/mage/usr/lib/mage/smage2.sh 2011/12/28 10:54:49 1578 @@ -555,24 +555,27 @@ { local stripdir="$@" - [ -z "${stripdir}" ] && stripdir=${BINDIR} - find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_LIB} 2> /dev/null + [[ -z ${stripdir} ]] && stripdir="${BINDIR}" + [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug" + find ${stripdir} ! -type d | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null } mstripbins() { local stripdir="$@" - [ -z "${stripdir}" ] && stripdir=${BINDIR} - find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_BIN} 2> /dev/null + [[ -z ${stripdir} ]] && stripdir="${BINDIR}" + [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug" + find ${stripdir} ! -type d | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null } mstripstatic() { local stripdir="$@" - [ -z "${stripdir}" ] && stripdir=${BINDIR} - find ${stripdir} | xargs file | grep "ar archive" | cut -f 1 -d : | xargs strip ${STRIP_STATIC_LIB} 2> /dev/null + [[ -z ${stripdir} ]] && stripdir="${BINDIR}" + [[ -z ${STRIP_STATIC_LIB} ]] && STRIP_STATIC_LIB="--strip-debug" + find ${stripdir} ! -type d | xargs file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_STATIC_LIB} 2> /dev/null } mcompressdocs()