Gentoo Archives: gentoo-portage-dev

From: "Kevin F. Quinn" <kevquinn@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] has_version and built_with_use ignore package.provided
Date: Sun, 06 Aug 2006 21:04:47
Message-Id: 20060806230343.3cb9aaeb@c1358217.kevquinn.com
In Reply to: [gentoo-portage-dev] has_version and built_with_use ignore package.provided by Paul Bredbury
1 On Sun, 06 Aug 2006 20:57:41 +0100
2 Paul Bredbury <brebs@××××.com> wrote:
3
4 > Hi, I was directed to this list after my Portage patches were
5 > rejected. I'm hoping that someone *other* than the rejecter will look
6 > at the bug, and: See it as a valid bug, reopen it, and take SpanKY's
7 > keyboard away so he can't reject it again.
8
9 From the IRC log, you already have solicited opinions from other
10 portage people and they agree with SpanKY. I assure you no-one is
11 going to take SpanKY's keyboard(s) away from him *shudder*.
12
13 > The bug is: http://bugs.gentoo.org/show_bug.cgi?id=139842
14 >
15 > Executive Summary: built_with_use returns the opposite answer to what
16 > it should, when the package referred to is not installed. I provided
17 > patches to stop that broken behaviour. People decided to talk about
18 > some mystical third state which doesn't exist in Boolean logic, and
19 > ended up convinced that black is white. And then proceeded to get
20 > themselves run over at the next Zebra crossing.
21
22 No, the value of built_with_use is meaningless when the package
23 referred to is not installed, so it doesn't matter whether it returns
24 true or false. It could just die if the package is not installed, but
25 there's little point. It's not a short-cut to calling has_version. If
26 you want to find out if a package is installed as well as whether it
27 has a specific USE flag set, do:
28
29 has_version <pkg> && built_with_use <blah> && <dostuff>
30
31 Note that frequently built_with_use is called referring to packages in
32 DEPEND, where the has_version is unnecessary.
33
34 You want built_with_use to return FALSE when the package is not
35 installed. Other cases would want it to return TRUE. The correct
36 answer is that you should not call built_with_use until you know the
37 package is installed.
38
39 To put it into boolean logic, you want built_with_use to do:
40
41 <installed> AND <USE=foo>
42
43 whereas others may want
44
45 <installed> IMPLIES <USE=foo>
46
47
48 The correct answer is to use has_version to do the installed check,
49 built_with_use to do the USE=foo check and code the conjunction as
50 required.
51
52 --
53 Kevin F. Quinn

Attachments

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

Replies