forked from kiss-community/kiss
Merge pull request #47 from kisslinux/nofile
stripping: swap to readelf
This commit is contained in:
commit
a1c84eb491
36
kiss
36
kiss
@ -257,29 +257,27 @@ pkg_strip() {
|
|||||||
|
|
||||||
# Strip only files matching the below mime-types from the package
|
# Strip only files matching the below mime-types from the package
|
||||||
# directory. No alternative to 'file' here sadly.
|
# directory. No alternative to 'file' here sadly.
|
||||||
find "$pkg_dir/$1" -type f -exec file -i {} + |
|
find "$pkg_dir/$1" -type f | while read -r file; do
|
||||||
while IFS=': ' read -r bin mime; do
|
case "$(readelf -h "$file" 2>/dev/null)" in
|
||||||
case $mime in
|
*" DYN "*)
|
||||||
application/x-sharedlib*|\
|
strip_opt=--strip-unneeded
|
||||||
application/x-pie-executable*)
|
;;
|
||||||
strip_opts=--strip-unneeded
|
|
||||||
;;
|
|
||||||
|
|
||||||
application/x-archive*)
|
*" REL "*)
|
||||||
strip_opts=--strip-debug
|
strip_opt=--strip-debug
|
||||||
;;
|
;;
|
||||||
|
|
||||||
application/x-executable*)
|
*" EXEC "*)
|
||||||
strip_opts=--strip-all
|
strip_opt=--strip-all
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*) continue ;;
|
*) continue ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Suppress errors here as some binaries and libraries may
|
# Suppress errors here as some binaries and libraries may
|
||||||
# fail to strip. This is OK.
|
# fail to strip. This is OK.
|
||||||
strip "$strip_opts" "$bin" 2>/dev/null &
|
strip "$strip_opt" "$file" 2>/dev/null &
|
||||||
done
|
done
|
||||||
|
|
||||||
wait
|
wait
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user