Use a SIGTERM signal to support a die call inside of a subshell.
authorZac Medico <zmedico@gentoo.org>
Mon, 25 Dec 2006 19:13:37 +0000 (19:13 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 25 Dec 2006 19:13:37 +0000 (19:13 -0000)
svn path=/main/trunk/; revision=5391

bin/ebuild.sh

index 709aefaeeb07caac5b5aae295e4c74d8a08210b2..d17a5ab037c29d866494f3f9e7c19208eb7a6d02 100755 (executable)
@@ -24,6 +24,10 @@ if [ "$*" != "depend" ] && [ "$*" != "clean" ] && [ "$*" != "nofetch" ]; then
        fi
 fi
 
+# subshell die support
+EBUILD_MASTER_PID=$$
+trap 'exit 1' SIGTERM
+
 EBUILD_SH_ARGS="$*"
 
 shift $#
@@ -263,6 +267,9 @@ diefunc() {
                        ${x} "$@" >&2 1>&2
                done
        fi
+
+       # subshell die support
+       kill -s SIGTERM ${EBUILD_MASTER_PID}
        exit 1
 }