Gentoo Archives: gentoo-dev

From: Tom Knight <tomk@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] use foo && bar vs. [ `use foo` ] && bar
Date: Mon, 19 Jul 2004 17:33:52
Message-Id: 20040719173349.GA26225@earwig.bogus
1 Hi
3 First I want to say how glad I am to be part of the dev team. I'll try my
4 best not to screw anything up, so excuse any silly questions I'm bound to
5 have.
7 Back on topic, I've searched for this on bugzilla, and didn't find anything,
8 but I'm sure it's come up on the forums before. There are several ebuilds
9 which have something along the lines of:
11 use foo && bar
13 Which executes bar if the foo USE flag is set, the problem is that the use
14 function not only returns true when the USE flag is set it also echos the
15 flag to stdout. When you emerge something you end up with loads of use flags
16 outputted.
18 The solution is to do it like this:
20 [ `use foo` ] && bar
22 Which returns true if foo is in USE, but doesn't output the USE flag.
24 I'm going have a go at fixing some of the net-mail packages, if others can
25 do the same taht would be great.
27 tom