Fix code from previous commit so it's guaranteed to always properly reset
authorZac Medico <zmedico@gentoo.org>
Tue, 8 Sep 2009 01:51:26 +0000 (01:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 8 Sep 2009 01:51:26 +0000 (01:51 -0000)
debug state.

svn path=/main/trunk/; revision=14215

bin/misc-functions.sh

index eee66eaa188093e940ee28de1d0d871e58eb64ba..93d5eca6d865e713e5179b3bdb1527730b465972 100755 (executable)
@@ -410,7 +410,11 @@ install_qa_check() {
        if [[ -n ${PORTAGE_LOG_FILE} && -r ${PORTAGE_LOG_FILE} ]] ; then
                # In debug mode, this variable definition will produce
                # a false positive if it's shown in the trace.
-               [[ $PORTAGE_DEBUG = 1 ]] && set +x
+               local reset_debug=0
+               if [[ ${-/x/} != $- ]] ; then
+                       set +x
+                       reset_debug=1
+               fi
                local m msgs=(
                        ": warning: dereferencing type-punned pointer will break strict-aliasing rules$"
                        ": warning: dereferencing pointer .* does break strict-aliasing rules$"
@@ -420,7 +424,7 @@ install_qa_check() {
                        ": warning: comparisons like X<=Y<=Z do not have their mathematical meaning$"
                        ": warning: null argument where non-null required "
                )
-               [[ $PORTAGE_DEBUG = 1 ]] && set -x
+               [[ $reset_debug = 1 ]] && set -x
                abort="no"
                i=0
                while [[ -n ${msgs[${i}]} ]] ; do