diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-11-20 21:45:21 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-11-21 00:51:43 +0000 |
commit | c27beab66023847435fb88cd5cc75916dca37057 (patch) | |
tree | c43c23133f5b837925785d5501aa4cff14980415 /subr/pkg_install_strip.subr | |
parent | d01c0269b8e5e467f82cd28392579c4c43fe63bc (diff) | |
download | midipix_build-c27beab66023847435fb88cd5cc75916dca37057.tar.bz2 midipix_build-c27beab66023847435fb88cd5cc75916dca37057.tar.xz |
Refactors build steps along the sequence {setup,fetch,configure,build,install}.
subr/mode_check_updates.subr: seperated into check_updates.sh.
subr/post_{copy_etc,sha256sums,tarballs}.subr: absorbed into `dist' target.
Diffstat (limited to 'subr/pkg_install_strip.subr')
-rw-r--r-- | subr/pkg_install_strip.subr | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/subr/pkg_install_strip.subr b/subr/pkg_install_strip.subr new file mode 100644 index 00000000..0a64b5a1 --- /dev/null +++ b/subr/pkg_install_strip.subr @@ -0,0 +1,31 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkgp_strip_tree() { + local _tree_root="${1}" _bin_path; + if [ ! -e "${_tree_root}" ]; then + return; + fi; + for _bin_path in $(find "${_tree_root}" -perm /a=x \ + \( -type f -or -type l \)); do + set +o errexit; + if objdump -sj .debug_info "${_bin_path}" >/dev/null 2>&1; then + log_msg info "Stripping ${_bin_path}..."; + log_msg vnfo "${TARGET}-strip ${_bin_path}"; + ${TARGET}-strip ${_bin_path}; + fi; + set -o errexit; + done; +}; + +pkg_strip() { + if [ "${PKG_NAME%flavour_minipix}" != "${PKG_NAME}" ] \ + && [ ${ARG_DEBUG_MINIPIX:-0} -eq 0 ]; then + pkgp_strip_tree "${PWD}/../destdir"; + elif [ "${BUILD}" = release ]; then + pkgp_strip_tree "${PWD}/../destdir/bin"; + fi; +}; + +# vim:filetype=sh |