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.
This commit is contained in:
parent
6ecbbf767a
commit
210b461028
|
@ -70,10 +70,6 @@ hook() {
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(file -b "$f") =~ "no machine" ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
fname=${f##*/}
|
fname=${f##*/}
|
||||||
for x in ${nostrip_files}; do
|
for x in ${nostrip_files}; do
|
||||||
if [ "$x" = "$fname" ]; then
|
if [ "$x" = "$fname" ]; then
|
||||||
|
@ -119,6 +115,13 @@ hook() {
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
application/x-sharedlib*|application/x-pie-executable*)
|
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"
|
chmod +w "$f"
|
||||||
# shared library
|
# shared library
|
||||||
make_debug "$f"
|
make_debug "$f"
|
||||||
|
@ -127,7 +130,7 @@ hook() {
|
||||||
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
|
msg_red "$pkgver: failed to strip ${f#$PKGDESTDIR}\n"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if [[ $(file $f) =~ "interpreter " ]]; then
|
if [[ $type =~ "interpreter " ]]; then
|
||||||
echo " Stripped position-independent executable: ${f#$PKGDESTDIR}"
|
echo " Stripped position-independent executable: ${f#$PKGDESTDIR}"
|
||||||
else
|
else
|
||||||
echo " Stripped library: ${f#$PKGDESTDIR}"
|
echo " Stripped library: ${f#$PKGDESTDIR}"
|
||||||
|
|
Loading…
Reference in New Issue