From 7df45accb9c83758d23e16753af02091c8a37469 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. Add further filtering for at least one of the executable bits to be set. --- 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..8294c97c0bf 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 -perm /111 | + while read f; do if [[ $(file -b "$f") =~ "no machine" ]]; then continue fi