diff options
author | Fabian Groffen <grobian@gentoo.org> | 2009-10-03 21:05:28 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2009-10-03 21:05:28 +0000 |
commit | db7df127e50599518290e5f7e6e4fed2d8267483 (patch) | |
tree | 5ae17bf31aba8e418c315a70f9b9a2ece1cd08d3 | |
parent | a7aa7a7381143eeaa30871c2351271cecf130d7b (diff) | |
download | portage-db7df127e50599518290e5f7e6e4fed2d8267483.tar.gz portage-db7df127e50599518290e5f7e6e4fed2d8267483.tar.bz2 portage-db7df127e50599518290e5f7e6e4fed2d8267483.zip |
- do not calculate source with of isolated-functions (for die function)
as we don't print it
- move paths to the bottom and print ${S} as it's often necessary when a
package fails.
- move error message up directly after the message it says it failed
(printing it below the code snippet usually just repeats the message)
svn path=/main/trunk/; revision=14483
-rwxr-xr-x | bin/isolated-functions.sh | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 9041846d0..be0f2c5c0 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -85,7 +85,7 @@ die() { (( n-- )) done (( n == 0 )) && (( n = ${#FUNCNAME[@]} - 1 )) - while (( n >= 0 )); do + while (( n > 0 )); do sourcefile=${BASH_SOURCE[${n}]} sourcefile=${sourcefile##*/} lineno=${BASH_LINENO[${n}]} ((filespacing < ${#sourcefile})) && filespacing=${#sourcefile} @@ -93,8 +93,9 @@ die() { (( n-- )) done + eerror "ERROR: $CATEGORY/$PF failed:" + eerror " ${*:-(no error message)}" eerror - eerror "ERROR: $CATEGORY/$PF failed." dump_trace 2 ${filespacing} ${linespacing} eerror " $(printf "%${filespacing}s" "${BASH_SOURCE[1]##*/}"), line $(printf "%${linespacing}s" "${BASH_LINENO[0]}"): Called die" eerror "The specific snippet of code:" @@ -119,21 +120,8 @@ die() { ${BASH_SOURCE[1]} \ | sed -e '1d' -e 's:^:RETAIN-LEADING-SPACE:' \ | while read -r n ; do eerror " ${n#RETAIN-LEADING-SPACE}" ; done - eerror " The die message:" - eerror " ${*:-(no error message)}" eerror eerror "If you need support, post the topmost build error, and the call stack if relevant." - [[ -n ${PORTAGE_LOG_FILE} ]] \ - && eerror "A complete build log is located at '${PORTAGE_LOG_FILE}'." - if [ -f "${T}/environment" ] ; then - eerror "The ebuild environment file is located at '${T}/environment'." - elif [ -d "${T}" ] ; then - { - set - export - } > "${T}/die.env" - eerror "The ebuild environment file is located at '${T}/die.env'." - fi if [[ -n ${EBUILD_OVERLAY_ECLASSES} ]] ; then eerror "This ebuild used the following eclasses from overlays:" local x @@ -161,7 +149,6 @@ die() { "named '$PORTAGE_REPO_NAME'" fi fi - eerror if [[ "${EBUILD_PHASE/depend}" == "${EBUILD_PHASE}" ]] ; then local x @@ -170,6 +157,19 @@ die() { done fi + [[ -n ${PORTAGE_LOG_FILE} ]] \ + && eerror "A complete build log is located at '${PORTAGE_LOG_FILE}'." + if [ -f "${T}/environment" ] ; then + eerror "The ebuild environment file is located at '${T}/environment'." + elif [ -d "${T}" ] ; then + { + set + export + } > "${T}/die.env" + eerror "The ebuild environment file is located at '${T}/die.env'." + fi + eerror "S: '${S}'" + [ -n "$EBUILD_EXIT_STATUS_FILE" ] && > "$EBUILD_EXIT_STATUS_FILE" # subshell die support |