1 |
On Thu, 2004-04-29, 20:34:12 +0000, in |
2 |
<200404292034.i3TKYCgi064017@×××××××××××××××××××××××.net>, |
3 |
brettholcomb@×××××××.net top-posted: |
4 |
> > |
5 |
> > From: "Michael Sterrett -Mr. Bones.-" <msterret@××××.com> Date: |
6 |
> > 2004/04/29 Thu PM 07:33:31 GMT To: Lars Strojny <lars@×××××××.net> |
7 |
> > CC: gentoo-dev@l.g.o Subject: [gentoo-dev] Re: Apply |
8 |
> > patch depending on USE flag |
9 |
> > |
10 |
> > On Thu, 29 Apr 2004, Lars Strojny wrote: |
11 |
> > |
12 |
> > > On Thu, 29 Apr 2004 18:20:48 +0100 Tom Wesley |
13 |
> > > <tom.wesley@××××××××.com> wrote: |
14 |
> > > |
15 |
> > > > On Thu, 2004-04-29 at 18:18, Ajai Khattri wrote: |
16 |
> > > > > I would like to have an ebuild apply a patch based on whether |
17 |
> > > > > a USE flag is set or not - what is the standard way to do this |
18 |
> > > > > in an ebuild? (Or is there some function already available to |
19 |
> > > > > do it?). |
20 |
> > > > |
21 |
> > > > You can |
22 |
> > > > |
23 |
> > > > if use nntp; then |
24 |
> > > > epatch ${DISTDIR}/${nntp_patch} |
25 |
> > > > fi |
26 |
> > > |
27 |
> > > I think |
28 |
> > > if [ "`use nntp`" ] ; then |
29 |
> > > is more elegant ;) |
30 |
> > |
31 |
> > Between the two, the first example is preferred. |
32 |
> > |
33 |
> Out of curiosity and because I'm doing some ebuilds and would like to |
34 |
> do them correctly why is the first preferred? |
35 |
|
36 |
I think that, eventually, they would like to phase out the requirement |
37 |
that use() have any kind of output. Also, decide for yourself which |
38 |
would be faster to determine and/or the more elegant solution: |
39 |
|
40 |
1) the exit status of use() |
41 |
|
42 |
2) the exit status of the `[` built-in after performing command |
43 |
substitution on the stdout from use() |
44 |
|
45 |
-- |
46 |
Batou: Hey, Major... You ever hear of "human rights"? |
47 |
Kusanagi: I understand the concept, but I've never seen it in action. |
48 |
--Ghost in the Shell |