cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 9ef498e3080042d7698e7d601b9943d373aa4ac8
parent 03073b8d2cf74a1eefddb51446bea1e730c5aefe
Author: Dylan Araps <dylan.araps@gmail.com>
Date:   Tue, 20 Aug 2019 11:05:36 +0000

kiss: faster stripping

Diffstat:
Mkiss | 37+++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/kiss b/kiss @@ -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() {