From: Simone Rota Date: Sat, 29 Apr 2006 08:01:53 +0000 (+0200) Subject: pkgmk: optimize file detection for stripping. Thanks to aon and mark X-Git-Url: http://gitweb/?a=commitdiff_plain;h=b0bbde50af5aba136af13bb0f5e3869e101914df;p=pkgutils-cross.git pkgmk: optimize file detection for stripping. Thanks to aon and mark --- diff --git a/ChangeLog b/ChangeLog index 47361a8..4e7f542 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-04-29 Simone Rota (sip at crux dot nu) + * Optimized file type detection for stripping in pkgmk + Thanks to Antti Nykänen 2006-04-14 Tilman Sauerbeck (tilman at crux nu) * ChangeLog, NEWS: Moved old ChangeLog to NEWS * pkgmk.in: Write warnings and errors to stderr instead of stdout diff --git a/pkgmk.in b/pkgmk.in index 51fd8f6..bfa1701 100755 --- a/pkgmk.in +++ b/pkgmk.in @@ -242,13 +242,16 @@ strip_files() { fi find . -type f -printf "%P\n" | $FILTER | while read FILE; do - if file -b "$FILE" | grep '^.*ELF.*executable.*not stripped$' &> /dev/null; then + case $(file -b "$FILE") in + *ELF*executable*not\ stripped) strip --strip-all "$FILE" - elif file -b "$FILE" | grep '^.*ELF.*shared object.*not stripped$' &> /dev/null; then + ;; + *ELF*shared\ object*not\ stripped) strip --strip-unneeded "$FILE" - elif file -b "$FILE" | grep '^current ar archive$' &> /dev/null; then + ;; + current\ ar\ archive) strip --strip-debug "$FILE" - fi + esac done }