For --debug mode, enable bash tracing when sourcing the ebuild. (trunk r14781)
authorZac Medico <zmedico@gentoo.org>
Sat, 7 Nov 2009 01:11:09 +0000 (01:11 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 7 Nov 2009 01:11:09 +0000 (01:11 -0000)
svn path=/main/branches/2.1.7/; revision=14794

bin/ebuild.sh

index 658ac64af59a63690b754adc731c1181414e9cd8..7a4e88bd824a1aec0fcfd9990662ca2a1735a1ae 100755 (executable)
@@ -1829,7 +1829,14 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
                # eclasses, they need to be unset before this process of
                # interaction begins.
                unset DEPEND RDEPEND PDEPEND IUSE
-               source "${EBUILD}" || die "error sourcing ebuild"
+
+               if [[ $PORTAGE_DEBUG != 1 ]] || [[ ${-/x/} != $- ]] ; then
+                       source "$EBUILD" || die "error sourcing ebuild"
+               else
+                       set -x
+                       source "$EBUILD" || die "error sourcing ebuild"
+                       set +x
+               fi
 
                if [[ "${EBUILD_PHASE}" != "depend" ]] ; then
                        RESTRICT=${PORTAGE_RESTRICT}