From 3d62ba684f95d38f77be28f82cfe9cadaf7635c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Fri, 16 Apr 2021 09:59:51 -0300 Subject: [PATCH] common/hooks/post-install: show error in $STRIPCMD in 06-strip-and-debug. Currently fails with a hard to understand error message: 2021-04-16T11:51:36.1074291Z => ERROR: rust-std-1.51.0_1: post-install_06-strip-and-debug-pkgs: '$STRIPCMD --strip-unneeded "$f"' exited with 1 --- common/hooks/post-install/06-strip-and-debug-pkgs.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh index 52591c38b31..2cec68412c5 100644 --- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh +++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh @@ -86,16 +86,14 @@ hook() { chmod +w "$f" if [[ $(file $f) =~ "statically linked" ]]; then # static binary - $STRIPCMD "$f" - if [ $? -ne 0 ]; then + if ! $STRIPCMD "$f"; then msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n" return 1 fi echo " Stripped static executable: ${f#$PKGDESTDIR}" else make_debug "$f" - $STRIPCMD "$f" - if [ $? -ne 0 ]; then + if ! $STRIPCMD "$f"; then msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n" return 1 fi @@ -125,8 +123,7 @@ hook() { chmod +w "$f" # shared library make_debug "$f" - $STRIPCMD --strip-unneeded "$f" - if [ $? -ne 0 ]; then + if ! $STRIPCMD --strip-unneeded "$f"; then msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n" return 1 fi @@ -139,8 +136,7 @@ hook() { ;; application/x-archive*) chmod +w "$f" - $STRIPCMD --strip-debug "$f" - if [ $? -ne 0 ]; then + if ! $STRIPCMD --strip-debug "$f"; then msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n" return 1 fi