summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-09 23:04:33 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-09 23:04:33 -0700
commit13a759213ec1fefe5e637e5467fe9d5f35d8f570 (patch)
treef95a6cd5073f6ad4776495edc248253421ec5f35 /bin
parent286675a500998e536dbbf2ee2dfe1fedf4290b38 (diff)
downloadportage-13a759213ec1fefe5e637e5467fe9d5f35d8f570.tar.gz
portage-13a759213ec1fefe5e637e5467fe9d5f35d8f570.tar.bz2
portage-13a759213ec1fefe5e637e5467fe9d5f35d8f570.zip
prepstrip: merge debugedit checks more
Use a ${debugedit_found} to remember if it's found or not, and use ${debugedit_warned} to avoid showing duplicate warnings.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild-helpers/prepstrip16
1 files changed, 11 insertions, 5 deletions
diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
index e22f417cb..bd518430e 100755
--- a/bin/ebuild-helpers/prepstrip
+++ b/bin/ebuild-helpers/prepstrip
@@ -36,6 +36,9 @@ type -P -- ${OBJCOPY} > /dev/null || OBJCOPY=objcopy
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_*}
@@ -50,9 +53,12 @@ inode_var_name() {
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
@@ -73,7 +79,7 @@ save_elf_debug() {
[[ ${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}")
@@ -185,7 +191,7 @@ done
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}"