Gentoo Archives: gentoo-dev

From: Aron Griffis <agriffis@g.o>
To: Gentoo Developers <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] would like this settled :)
Date: Sat, 24 Apr 2004 22:27:14
Message-Id: 20040424222418.GA7878@mustard.flatmonk.org
In Reply to: Re: [gentoo-dev] would like this settled :) by "Robin H. Johnson"
1 Robin H. Johnson wrote: [Sat Apr 24 2004, 01:47:18PM EDT]
2 > As simple as this sounds, it doesn't work, because the die call inside
3 > econf never lets us reach this code.
4
5 You can do put it in a subshell
6
7 if ! ( econf ); then
8
9 But this really sucks. die is designed to tell you at what line, with
10 a custom message, an ebuild failed. When functions in ebuild.sh call
11 die directly, then both those features are thwarted. The line number
12 is useless (we don't _care_ where it died in ebuild.sh) and the
13 message is hard-coded.
14
15 Consider an ebuild with the following:
16
17 cd dir1; econf
18 cd ../dir2; econf
19 cd ../dir3; econf
20
21 In this case the message will currently be the same regardless of
22 which ebuild fails! How annoying. Could we please fix this in
23 ebuild.sh so that exceptions are propagated to the caller as return
24 status, which can then call die on its own?
25
26 cd dir1; econf || die "econf failed in dir1"
27 cd ../dir2; econf || die "econf failed in dir2"
28 cd ../dir3; econf || die "econf failed in dir3"
29
30 Regards,
31 Aron
32
33 --
34 Aron Griffis
35 Gentoo Linux Developer (alpha / baselayout / ia64 / mozilla / mutt / ruby / vim)

Replies

Subject Author
Re: [gentoo-dev] would like this settled :) Drake Wyrm <wyrm@×××××.com>