mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-02 01:18:08 +01:00
Restore permissions on stripped files
This commit is contained in:
parent
1fbc21935f
commit
614482220c
3 changed files with 17 additions and 9 deletions
|
|
@ -447,6 +447,20 @@ default_src_install() {
|
|||
make -f Makefile install PREFIX="${PREFIX}" DESTDIR="${DESTDIR}"
|
||||
}
|
||||
|
||||
# Helper function for permissions
|
||||
_do_strip() {
|
||||
# shellcheck disable=SC2124
|
||||
local f="${@: -1}"
|
||||
if ! [ -w "${f}" ]; then
|
||||
local perms="$(stat -c %a "${f}")"
|
||||
chmod u+w "${f}"
|
||||
fi
|
||||
strip "$@"
|
||||
if [ -n "${perms}" ]; then
|
||||
chmod "${perms}" "${f}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Default function for postprocessing binaries.
|
||||
default_src_postprocess() {
|
||||
if (command -v find && command -v file && command -v strip) >/dev/null 2>&1; then
|
||||
|
|
@ -454,15 +468,15 @@ default_src_postprocess() {
|
|||
# shellcheck disable=SC2162
|
||||
find "${DESTDIR}" -type f | while read f; do
|
||||
case "$(file -bi "${f}")" in
|
||||
application/x-executable*) strip "${f}" ;;
|
||||
application/x-executable*) _do_strip "${f}" ;;
|
||||
application/x-sharedlib*|application/x-pie-executable*)
|
||||
machine_set="$(file -b "${f}")"
|
||||
case "${machine_set}" in
|
||||
*no\ machine*) ;; # don't strip ELF container-only
|
||||
*) strip --strip-unneeded "${f}" ;;
|
||||
*) _do_strip --strip-unneeded "${f}" ;;
|
||||
esac
|
||||
;;
|
||||
application/x-archive*) strip --strip-debug "${f}" ;;
|
||||
application/x-archive*) _do_strip --strip-debug "${f}" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -51,7 +51,4 @@ src_install() {
|
|||
# Improve reproducibility. hostcat might be empty or set to "cat /etc/hosts"
|
||||
# depending on whether /etc/hosts was available during the build.
|
||||
sed -i "s_^hostcat='.*'\$_hostcat=''_g" "${DESTDIR}${PREFIX}/lib/perl5/5.32.1/i386-linux/Config_heavy.pl"
|
||||
|
||||
# There are strange permissions on installed files.
|
||||
find "${DESTDIR}${PREFIX}/lib" -type f -exec chmod 644 {} \;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,4 @@ src_install() {
|
|||
|
||||
# Remove messed up manpages
|
||||
rm "${DESTDIR}/"*.0
|
||||
|
||||
# There are strange permissions on installed files.
|
||||
find "${DESTDIR}${PREFIX}/lib" -type f -exec chmod 644 {} \;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue