midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame subr/pkg_install_strip.subr

Lucio Andrés Illanes Albornoz 378fac
#
Lucio Andrés Illanes Albornoz 378fac
# set -o errexit -o noglob are assumed.
Lucio Andrés Illanes Albornoz 378fac
#
Lucio Andrés Illanes Albornoz 378fac
Lucio Andrés Illanes Albornoz 378fac
pkgp_strip_tree() {
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
	local _tree_root="${1}" _bin_path;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
	if [ ! -e "${_tree_root}" ]; then
Lucio Andrés Illanes Albornoz 378fac
		return;
Lucio Andrés Illanes Albornoz 378fac
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
	for _bin_path in $(find "${_tree_root}" -perm /a=x	\
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
			\( -type f -or -type l \)); do
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
		set +o errexit;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
		if objdump -sj .debug_info "${_bin_path}" >/dev/null 2>&1; then
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
			log_msg info "Stripping ${_bin_path}...";
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
			log_msg vnfo "${TARGET}-strip ${_bin_path}";
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
			${TARGET}-strip ${_bin_path};
Lucio Andrés Illanes Albornoz 378fac
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
		set -o errexit;
Lucio Andrés Illanes Albornoz 378fac
	done;
Lucio Andrés Illanes Albornoz 378fac
};
Lucio Andrés Illanes Albornoz 378fac
Lucio Andrés Illanes Albornoz 378fac
pkg_strip() {
Lucio Andrés Illanes Albornoz 378fac
	if [ "${PKG_NAME%flavour_minipix}" != "${PKG_NAME}" ]	\
Lucio Andrés Illanes Albornoz 378fac
	&& [ ${ARG_DEBUG_MINIPIX:-0} -eq 0 ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 022f7e
		pkgp_strip_tree "${PKG_DESTDIR}";
Lucio Andrés Illanes Albornoz 378fac
	elif [ "${BUILD}" = release ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 022f7e
		pkgp_strip_tree "${PKG_DESTDIR}/bin";
Lucio Andrés Illanes Albornoz 378fac
	fi;
Lucio Andrés Illanes Albornoz 378fac
};
Lucio Andrés Illanes Albornoz 378fac
Lucio Andrés Illanes Albornoz 378fac
# vim:filetype=sh