aboutsummaryrefslogtreecommitdiff
path: root/common/hooks
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-01-28 00:18:07 +0000
committerLeah Neukirchen <leah@vuxu.org>2021-01-30 14:20:53 +0000
commit210b461028f206f1dc1e300bfee6fd0a14eea8a4 (patch)
treeed1aacecfc278982970561147c60813b2c898548 /common/hooks
parent6ecbbf767a9d202d00d4eb069ec819e28d75a6a6 (diff)
downloadvoid-packages-210b461028f206f1dc1e300bfee6fd0a14eea8a4.tar
void-packages-210b461028f206f1dc1e300bfee6fd0a14eea8a4.tar.gz
void-packages-210b461028f206f1dc1e300bfee6fd0a14eea8a4.tar.bz2
void-packages-210b461028f206f1dc1e300bfee6fd0a14eea8a4.tar.lz
void-packages-210b461028f206f1dc1e300bfee6fd0a14eea8a4.tar.xz
void-packages-210b461028f206f1dc1e300bfee6fd0a14eea8a4.tar.zst
void-packages-210b461028f206f1dc1e300bfee6fd0a14eea8a4.zip
hooks/post-install/06-strip-and-debug-pkgs.sh: speed up.
Only run file once for each file in the destdir, only double-check when we are about to strip the ELF files.
Diffstat (limited to 'common/hooks')
-rw-r--r--common/hooks/post-install/06-strip-and-debug-pkgs.sh13
1 files changed, 8 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..52591c38b31 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -70,10 +70,6 @@ hook() {
continue
fi
- if [[ $(file -b "$f") =~ "no machine" ]]; then
- continue
- fi
-
fname=${f##*/}
for x in ${nostrip_files}; do
if [ "$x" = "$fname" ]; then
@@ -119,6 +115,13 @@ hook() {
fi
;;
application/x-sharedlib*|application/x-pie-executable*)
+ local type="$(file -b "$f")"
+ if [[ $type =~ "no machine" ]]; then
+ # using ELF as a container format (e.g. guile)
+ echo " Ignoring ELF file without machine set: ${f#$PKGDESTDIR}"
+ continue
+ fi
+
chmod +w "$f"
# shared library
make_debug "$f"
@@ -127,7 +130,7 @@ hook() {
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
return 1
fi
- if [[ $(file $f) =~ "interpreter " ]]; then
+ if [[ $type =~ "interpreter " ]]; then
echo " Stripped position-independent executable: ${f#$PKGDESTDIR}"
else
echo " Stripped library: ${f#$PKGDESTDIR}"