hooks/strip: make sure to use strip(1) and not our wrapper.

This commit is contained in:
Juan RP 2015-04-28 09:47:39 +02:00
parent 7ab311d4aa
commit cd8a29cb62

View file

@ -56,12 +56,14 @@ create_debug_pkg() {
} }
hook() { hook() {
local fname= x= f= _soname= local fname= x= f= _soname= STRIPCMD=
if [ -n "$nostrip" -o -n "$noarch" ]; then if [ -n "$nostrip" -o -n "$noarch" ]; then
return 0 return 0
fi fi
STRIPCMD=/usr/bin/$STRIP
find ${PKGDESTDIR} -type f | while read f; do find ${PKGDESTDIR} -type f | while read f; do
if [[ $f =~ ^/usr/lib/debug/ ]]; then if [[ $f =~ ^/usr/lib/debug/ ]]; then
continue continue
@ -83,7 +85,7 @@ hook() {
chmod +w "$f" chmod +w "$f"
if echo "$(file $f)" | grep -q "statically linked"; then if echo "$(file $f)" | grep -q "statically linked"; then
# static binary # static binary
$STRIP "$f" $STRIPCMD "$f"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n" msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1 return 1
@ -91,7 +93,7 @@ hook() {
echo " Stripped static executable: ${f#$PKGDESTDIR}" echo " Stripped static executable: ${f#$PKGDESTDIR}"
else else
make_debug "$f" make_debug "$f"
$STRIP "$f" $STRIPCMD "$f"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n" msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1 return 1
@ -104,7 +106,7 @@ hook() {
chmod +w "$f" chmod +w "$f"
# shared library # shared library
make_debug "$f" make_debug "$f"
$STRIP --strip-unneeded "$f" $STRIPCMD --strip-unneeded "$f"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n" msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1 return 1
@ -118,7 +120,7 @@ hook() {
;; ;;
application/x-archive*) application/x-archive*)
chmod +w "$f" chmod +w "$f"
$STRIP --strip-debug "$f" $STRIPCMD --strip-debug "$f"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n" msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1 return 1