From 1d304d0ab4e041092a447182f0a33a3129c8d215 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 22 Mar 2006 23:47:03 +0000 Subject: Enable bash tracing during sourcing of bashrc for --debug mode. See bug #126442. svn path=/main/trunk/; revision=2971 --- bin/ebuild.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bin/ebuild.sh') 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" -- cgit v1.2.3-1-g7c22