Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: [gentoo-portage-dev] allow extra info to be echod on die
Date: Wed, 05 Oct 2005 19:17:08
Message-Id: 20051005191457.GA10159@nightcrawler
In Reply to: Re: [gentoo-dev] Re: [gentoo-portage-dev] allow extra info to be echod on die by Aron Griffis
1 On Wed, Oct 05, 2005 at 03:04:23PM -0400, Aron Griffis wrote:
2 > Brian Harring wrote: [Wed Oct 05 2005, 02:47:09PM EDT]
3 > >> diefunc() {
4 > >> local funcname="$1" lineno="$2" exitcode="$3"
5 > >> shift 3
6 > >> @@ -289,6 +291,7 @@
7 > >> echo "!!! ${*:-(no error message)}" >&2
8 > >> echo "!!! If you need support, post the topmost build error, NOT
9 > >this status message." >&2
10 > >> echo >&2
11 > >> + for x in $EBUILD_DEATH_HOOKS; do
12 > >> + ${x} "$1" "$2" "$3"
13 > >> + done
14 > >> exit 1
15 > >> }
16 >
17 > Is this exactly what went in? It looks like you're trying to use
18 > positional params that were shifted earlier.
19
20 No, the hooks are called with "$@" actually, plus some checks to
21 ensure that
22 A) the output goes to stderr, which is the norm for die
23 B) the hooks aren't engaged during depends phase.
24
25 if people are after the func/line/exit code being handed to the hook,
26 it can be changed, the intention was for this to allow dumping extra
27 debug info.
28 ~harring