Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@g.o>
To: gentoo-portage-dev@l.g.o
Cc: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [gentoo-portage-dev] allow extra info to be echod on die
Date: Wed, 05 Oct 2005 18:52:25
Message-Id: 20051005184709.GD7855@nightcrawler
1 Just an addendum to this... it went in, will be available in
2 2.0.51_rc4 and up.
3
4 If you want all registered death funcs to kick in,
5
6 EBUILD_DEATH_HOOKS="$EBUILD_DEATH_HOOKS the_name_of_your_func"
7
8 or if you want just your func to run
9
10 EBUILD_DEATH_HOOKS="the_name_of_your_func"
11
12 CC'ing gentoo-dev, since I'd expect some devs would be interested in
13 it.
14 ~harring
15
16 On Wed, Oct 05, 2005 at 11:48:01AM -0500, Brian Harring wrote:
17 > On Wed, Oct 05, 2005 at 04:33:17PM +0000, Thomas Matthijs wrote:
18 > > Hi,
19 > >
20 > > I would really like a way to echo more information when a die happens so
21 > > the users can paste it in their bug report
22 > >
23 > > Only needs a very simple change to ebuild.sh:
24 > >
25 > EBUILD_DEATH_HOOKS=''
26 >
27 > diefunc() {
28 > local funcname="$1" lineno="$2" exitcode="$3"
29 > shift 3
30 > @@ -289,6 +291,7 @@
31 > echo "!!! ${*:-(no error message)}" >&2
32 > echo "!!! If you need support, post the topmost build error, NOT this status message." >&2
33 > echo >&2
34 > + for x in $EBUILD_DEATH_HOOKS; do
35 > + ${x} "$1" "$2" "$3"
36 > + done
37 > exit 1
38 > }
39 > ^^^ something like that I think is a bit better; passing the diefunc
40 > args to the hooks also.
41 > ~harring

Replies