1 |
On Sun, 2010-02-07 at 14:19 -0800, Zac Medico wrote: |
2 |
> On 02/07/2010 01:10 PM, Stelian Ionescu wrote: |
3 |
> > Wouldn't it be a good idea to use "set -e" in the ebuild environment ? |
4 |
> > I've seen cases of ebuilds calling epatch without inheriting from eutils |
5 |
> > which compiled and installed (apparently) fine but possibly broken |
6 |
> > binaries. Examples of cases where "set -e" would have helped: 303849, |
7 |
> > 297063, 260279, 221257, |
8 |
> > https://bugs.gentoo.org/buglist.cgi?quicksearch=command+not+found |
9 |
> > and perhaps others I haven't managed to find in bugzilla |
10 |
> |
11 |
> I don't know what kind of side-effects set -e would introduce, but |
12 |
> we can easily add a repoman check for epatch calls without eutils |
13 |
> inherit. |
14 |
|
15 |
"Exit immediately if a pipeline (which may consist of a single simple |
16 |
command), a subshell command enclosed in parentheses, or one of the |
17 |
commands executed as part of a command list enclosed by braces (see |
18 |
SHELL GRAMMAR above) exits with a non-zero status. The shell does not |
19 |
exit if the com- mand that fails is part of the command list |
20 |
immediately following a while or until keyword, part of the test |
21 |
following the if or elif reserved words, part of any command executed |
22 |
in a && or || list except the command following the final && or ||, |
23 |
any command in a pipeline but the last, or if the command's return |
24 |
value is being inverted with !. A trap on ERR, if set, is executed |
25 |
before the shell exits. This option applies to the shell environment |
26 |
and each subshell environment separately (see COMMAND EXECUTION |
27 |
ENVIRONMENT above), and may cause subshells to exit before executing |
28 |
all the commands in the subshell." |
29 |
|
30 |
> Portage already does a search of the build log for 'command not |
31 |
> found' messages and generates a QA warnings. Set |
32 |
> PORTAGE_ELOG_CLASSES="${PORTAGE_ELOG_CLASSES} qa" in /etc/make.conf |
33 |
> if you want to have those warnings logged. |
34 |
|
35 |
My point is that whenever the ebuild is trying to execute a command that |
36 |
does not exist, it should die immediately because there's no way to know |
37 |
how the failure to execute that command might affect the rest of the |
38 |
build process |
39 |
epatch was just an example because it's probably the most used function |
40 |
from eutils.eclass |
41 |
|
42 |
-- |
43 |
Stelian Ionescu a.k.a. fe[nl]ix |
44 |
Quidquid latine dictum sit, altum videtur. |
45 |
http://common-lisp.net/project/iolib |