Gentoo Archives: gentoo-dev

From: Matthias Schwarzott <zzam@g.o>
To: gentoo-dev@l.g.o
Cc: Thomas Sachau <tommy@g.o>
Subject: Re: [gentoo-dev] Usage of econf with an additional || die
Date: Tue, 30 Sep 2008 17:10:54
Message-Id: 200809301910.49138.zzam@gentoo.org
In Reply to: Re: [gentoo-dev] Usage of econf with an additional || die by Thomas Sachau
1 On Dienstag, 30. September 2008, Thomas Sachau wrote:
2 >
3 > From my knowledge and experience with sunrise:
4 >
5 > some functions that dont need "|| die":
6 > epatch, econf, eqmake3, eqmake4
7 >
8 > some functions that need "|| die":
9 > emake, do*
10 >
11 > Afaik die wont work in a subshell independent of how it is called, so the
12 > die from econf wont work, but also the "emake || die" one would also not
13 > work.
14
15 Well there might be some cases when die does not work fine, I am not sure.
16 But it IS designed to work in subshells.
17 Looking into /usr/lib/portage/bin/isolated-functions.sh: die basically calls
18 kill -s SIGTERM ${EBUILD_MASTER_PID}
19
20
21 and sigterm is catched in /usr/lib/portage/bin/ebuild.sh
22
23 # subshell die support
24 EBUILD_MASTER_PID=$$
25 trap 'exit 1' SIGTERM
26
27 and btw. econf is also implemented as a function in ebuild.sh so it even is
28 executed inside the "main" ebuild bash process - no subshell here.
29
30 Regards
31 Matthias