Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Cc: Stelian Ionescu <sionescu@××××.org>
Subject: Re: [gentoo-dev] Calling unknown commands in an ebuild
Date: Mon, 08 Feb 2010 02:21:01
Message-Id: 201002072122.01908.vapier@gentoo.org
In Reply to: [gentoo-dev] Calling unknown commands in an ebuild by Stelian Ionescu
1 On Sunday 07 February 2010 16:10:10 Stelian Ionescu wrote:
2 > Wouldn't it be a good idea to use "set -e" in the ebuild environment ?
3 > I've seen cases of ebuilds calling epatch without inheriting from eutils
4 > which compiled and installed (apparently) fine but possibly broken
5 > binaries.
6
7 this is not the way to approach the problem. 'set -e' has a lot of
8 implications people don't realize. _any_ command that exits with non-zero
9 will break things. such as:
10 matches=`grep foo ./some-file`
11 no matches of 'foo' will cause the ebuild to exit immediately. it doesnt take
12 much effort to find plenty of other examples.
13
14 it also valid to try and do something like `foo --version >& /dev/null` as a
15 naive test to see if a program exists and works. messing with the fundamental
16 'command not found' behavior may unintentionally break this.
17
18 > https://bugs.gentoo.org/buglist.cgi?quicksearch=command+not+found
19 > and perhaps others I haven't managed to find in bugzilla
20
21 many of those would still fail with `set -e` in the ebuild environment because
22 the missing command is run through a build system like makefiles.
23 ebuild -> make -> shell -> no command found
24 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature