prepstrip: merge debugedit checks
authorMike Frysinger <vapier@gentoo.org>
Sun, 9 Oct 2011 22:53:53 +0000 (18:53 -0400)
committerMike Frysinger <vapier@gentoo.org>
Mon, 10 Oct 2011 02:27:58 +0000 (22:27 -0400)
Avoid checking for debugedit multiple times.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
bin/ebuild-helpers/prepstrip

index 5f0fe18fe8871a297ee45f8cd10c303f5d76803b..5167ef329d7439c82177bac4e759bd44f982f309 100755 (executable)
@@ -25,11 +25,6 @@ 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}
 
-if has installsources ${FEATURES} && ! 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!"
-fi
-
 unset ${!INODE_*}
 
 inode_var_name() {
@@ -43,7 +38,11 @@ inode_var_name() {
 save_elf_sources() {
        has installsources ${FEATURES} || return 0
        has installsources ${RESTRICT} && return 0
-       type -P debugedit >/dev/null || 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!"
+               return 0
+       fi
 
        local x=$1
        local inode=$(inode_var_name "$x")