kiss: only attempt to strip files in specific locations

This commit is contained in:
Dylan Araps 2021-07-17 16:01:17 +03:00
parent cd29cb3eaa
commit 501c4d315e
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
1 changed files with 8 additions and 3 deletions

11
kiss
View File

@ -554,7 +554,12 @@ pkg_strip() {
# 0000000 ! < a r c h > \n /
# 0000020
# 0000022
find "$pkg_dir/$1" -type f | while read -r file; do
while read -r file; do case $file in
# Look only in these locations for files of interest (libraries,
# programs, etc). This includes all subdirectories. Old behavior
# would run od on all files (upwards of 4000 for Python).
*/sbin/?*|*/bin/?*|*/lib/?*|*/lib??/?*|*/lib???/?*|*/lib????/?*)
case $(od -A o -t c -N 18 "$file") in
# REL (object files (.o), static libraries (.a)).
*177*E*L*F*0000020\ 001\ *|*\!*\<*a*r*c*h*\>*)
@ -569,7 +574,7 @@ pkg_strip() {
strip -s -R .comment -R .note "$file"
;;
esac
done 2>/dev/null || :
esac done < "$pkg_dir/$1/$pkg_db/$1/manifest" 2>/dev/null || :
}
pkg_fix_deps() {
@ -844,8 +849,8 @@ pkg_build_all() {
! [ -f "$repo_dir/sources" ] || pkg_extract "$pkg"
pkg_build "$pkg"
pkg_strip "$pkg"
pkg_manifest "$pkg"
pkg_strip "$pkg"
pkg_fix_deps "$pkg"
pkg_etcsums "$pkg"
pkg_tar "$pkg"