diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-08-20 11:05:36 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-08-20 11:05:36 +0000 |
commit | a7aba1770d87e477835035f2f7b8b7947e1ddcce (patch) | |
tree | 38486be3a44199a5e513dd95c533b815003d4697 /kiss | |
parent | baa17bf704e5e0be23ea9350634b6b9ced50a7cc (diff) | |
download | cpt-a7aba1770d87e477835035f2f7b8b7947e1ddcce.tar.gz |
kiss: faster stripping
FossilOrigin-Name: 660032959d790538175bf868c1d88acaefbb6410f82a20c468bd50d9fded5387
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 37 |
1 files changed, 23 insertions, 14 deletions
@@ -278,22 +278,31 @@ pkg_strip() { # Strip only files matching the below mime-types from the package # directory. No alternative to 'file' here sadly. - find "$pkg_dir/$1" -type f | while read -r binary; do - case $(file -bi "$binary") in - application/x-sharedlib*|application/x-pie-executable*) - strip_opts=--strip-unneeded - ;; + find "$pkg_dir/$1" -type f -exec file -i {} + | + while IFS=': ' read -r bin mime; do + case $mime in + application/x-sharedlib*|\ + application/x-pie-executable*) + strip_opts=--strip-unneeded + ;; + + application/x-archive*) + strip_opts=--strip-debug + ;; + + application/x-executable*) + strip_opts=--strip-all + ;; + + *) continue ;; + esac - application/x-archive*) strip_opts=--strip-debug ;; - application/x-executable*) strip_opts=--strip-all ;; + # Suppress errors here as some binaries and libraries may + # fail to strip. This is OK. + strip "$strip_opts" "$bin" 2>/dev/null & + done - *) continue ;; - esac - - # Suppress errors here as some binaries and libraries may - # fail to strip. This is OK. - strip "$strip_opts" "$binary" 2>/dev/null ||: - done + wait } pkg_fixdeps() { |