die: include $EBUILD_PHASE in message
authorZac Medico <zmedico@gentoo.org>
Sun, 30 Jan 2011 23:24:48 +0000 (15:24 -0800)
committerZac Medico <zmedico@gentoo.org>
Sun, 30 Jan 2011 23:24:48 +0000 (15:24 -0800)
When a helper binary dies automatically in EAPI 4 and later, we don't
get a stack trace, so at least report the phase that failed.

bin/isolated-functions.sh

index 8af202f6576c1be2d8f6ecd2cab62dc5800ebd76..f89c11ed5653d60aa3dc98910cc8cefd5ac47870 100644 (file)
@@ -136,7 +136,11 @@ die() {
                (( n-- ))
        done
 
-       eerror "ERROR: $CATEGORY/$PF failed:"
+       # When a helper binary dies automatically in EAPI 4 and later, we don't
+       # get a stack trace, so at least report the phase that failed.
+       local phase_str=
+       [[ -n $EBUILD_PHASE ]] && phase_str=" ($EBUILD_PHASE phase)"
+       eerror "ERROR: $CATEGORY/$PF failed${phase_str}:"
        eerror "  ${*:-(no error message)}"
        eerror
        # dump_trace is useless when the main script is a helper binary