For --debug mode, enable bash tracing when sourcing the ebuild.
authorZac Medico <zmedico@gentoo.org>
Fri, 6 Nov 2009 22:28:44 +0000 (22:28 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 6 Nov 2009 22:28:44 +0000 (22:28 -0000)
svn path=/main/trunk/; revision=14781

bin/ebuild.sh

index 25cd04bad83307e965509c2b9e6d35215bc0617e..0a8fb41abf42a2b165675f61d9eda86f75e3fe32 100755 (executable)
@@ -1823,7 +1823,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}