export SAFE_STRIP_FLAGS="--strip-unneeded"
export PORTAGE_STRIP_FLAGS=${PORTAGE_STRIP_FLAGS-${SAFE_STRIP_FLAGS} -R .comment}
prepstrip_sources_dir=/usr/src/debug/${CATEGORY}/${PF}
+type -P debugedit >/dev/null
+debugedit_found=$?
+debugedit_warned=
unset ${!INODE_*}
save_elf_sources() {
${FEATURES_installsources} || return 0
${RESTRICT_installsources} && return 0
- if ! type -P debugedit >/dev/null ; then
- ewarn "FEATURES=installsources is enabled but the debugedit binary could not"
- ewarn "be found. This feature will not work unless debugedit is installed!"
+ if [ ${debugedit_found} -ne 0 ] ; then
+ if [ -z ${debugedit_warned} ] ; then
+ debugedit_warned=1
+ ewarn "FEATURES=installsources is enabled but the debugedit binary could not"
+ ewarn "be found. This feature will not work unless debugedit is installed!"
+ fi
return 0
fi
[[ ${x} == *".debug" ]] && return 0
# this will recompute the build-id, but for now that's ok
- local buildid="$( type -P debugedit >/dev/null && debugedit -i "${x}" )"
+ local buildid="$( [ ${debugedit_found} -eq 0 ] && debugedit -i "${x}" )"
mkdir -p $(dirname "${y}")
if [[ -s ${T}/debug.sources ]] && \
${FEATURES_installsources} && \
! ${RESTRICT_installsources} && \
- type -P debugedit >/dev/null
+ [ ${debugedit_found} -eq 0 ]
then
vecho "installsources: rsyncing source files"
[[ -d ${D}${prepstrip_sources_dir} ]] || mkdir -p "${D}${prepstrip_sources_dir}"