From: Zac Medico Date: Wed, 22 Mar 2006 23:47:03 +0000 (-0000) Subject: Enable bash tracing during sourcing of bashrc for --debug mode. See bug #126442. X-Git-Tag: v2.1_pre7~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1d304d0ab4e041092a447182f0a33a3129c8d215;p=portage.git Enable bash tracing during sourcing of bashrc for --debug mode. See bug #126442. svn path=/main/trunk/; revision=2971 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index d5e6ef682..410425d21 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -42,7 +42,15 @@ OCC="$CC" OCXX="$CXX" source /etc/profile.env &>/dev/null if [ -f "${PORTAGE_BASHRC}" ]; then - source "${PORTAGE_BASHRC}" + # If $- contains x, then tracing has already enabled elsewhere for some + # reason. We preserve it's state so as not to interfere. + if [ "$PORTAGE_DEBUG" != "1" ] || [ "${-/x/}" != "$-" ]; then + source "${PORTAGE_BASHRC}" + else + set -x + source "${PORTAGE_BASHRC}" + set +x + fi fi [ ! -z "$OCC" ] && export CC="$OCC" [ ! -z "$OCXX" ] && export CXX="$OCXX"