X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Fstripper;h=ac5f58ca50cb76f858de26c3108d741cb5f87d65;hb=e4f287a268c490e393e2e7ffd5bdd8246c3d3f76;hp=f121d35919fb967c6469c54b32d4f791ea631480;hpb=5b117ef49aaad5f39a81938783b2cfe05fc5d91c;p=people%2Fpmueller%2Fipfire-2.x.git diff --git a/src/stripper b/src/stripper index f121d35919..ac5f58ca50 100755 --- a/src/stripper +++ b/src/stripper @@ -17,7 +17,7 @@ done function _strip() { local file=${1} - local cmd="${STRIP-strip}" + local strip="${STRIP-strip}" local exclude l for exclude in ${excludes}; do @@ -27,17 +27,19 @@ function _strip() { fi done + local cmd=( "${strip}" ) + case "$(file -bi ${file})" in - application/x-sharedlib*|application/x-archive*) - cmd="${cmd} --strip-debug --remove-section=.comment --remove-section=.note" + application/x-archive*) + cmd+=( "--strip-debug" "--remove-section=.comment" "--remove-section=.note" ) ;; *) - cmd="${cmd} --strip-unneeded" + cmd+=( "--strip-all" ) ;; esac echo "Stripping ${file}..." - ${cmd} ${file} + ${cmd[*]} ${file} } for dir in ${dirs}; do