From c3c51646b189ece2c5324bd9bf70111416790477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Wed, 27 Jan 2021 20:39:28 -0300 Subject: [PATCH] hooks/post-install: speed up 06-strip-and-debug-pkgs.sh. Files under /usr/share can't be stripped at all, since they shouldn't be ELFs (if they are ELFs, they are unlikely to be ELFs for the target and suitable for being stripped / debugged). Since some big data packages have a lot of files /usr/share, this can considerably speed up the hook, for no change in the package output. --- common/hooks/post-install/06-strip-and-debug-pkgs.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 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 b59dde5ab3c..af76b5e4d8b 100644 --- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh +++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh @@ -65,11 +65,10 @@ hook() { STRIPCMD=/usr/bin/$STRIP - find ${PKGDESTDIR} -type f | while read f; do - if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then - continue - fi - + find ${PKGDESTDIR} \ + -path ${PKGDESTDIR}/usr/share/ -prune -path ${PKGDESTDIR}/usr/lib/debug/ -prune \ + -type f | + while read f; do if [[ $(file -b "$f") =~ "no machine" ]]; then continue fi