Make diefunc() clean up QA_INTERCEPTORS in case it is
authorZac Medico <zmedico@gentoo.org>
Sun, 11 Nov 2007 22:17:05 +0000 (22:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 11 Nov 2007 22:17:05 +0000 (22:17 -0000)
called from inherit() since sed called below.

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

bin/isolated-functions.sh

index f471f8cae255bcf9631e63c4dba74fdabb4e517c..b46f50a4d9ec917cd3968c78dcd6872b9d5742d7 100755 (executable)
@@ -41,7 +41,12 @@ dump_trace() {
 diefunc() {
        local funcname="$1" lineno="$2" exitcode="$3"
        shift 3
-
+       if [ -n "${QA_INTERCEPTORS}" ] ; then
+               # die was called from inside inherit. We need to clean up
+               # QA_INTERCEPTORS since sed is called below.
+               unset -f ${QA_INTERCEPTORS}
+               unset QA_INTERCEPTORS
+       fi
        local n filespacing=0 linespacing=0
        # setup spacing to make output easier to read
        for ((n = ${#FUNCNAME[@]} - 1; n >= 0; --n)); do