On Sun, 06 Aug 2006 20:57:41 +0100
Paul Bredbury <[EMAIL PROTECTED]> wrote:

> Hi, I was directed to this list after my Portage patches were
> rejected. I'm hoping that someone *other* than the rejecter will look
> at the bug, and: See it as a valid bug, reopen it, and take SpanKY's
> keyboard away so he can't reject it again.

From the IRC log, you already have solicited opinions from other
portage people and they agree with SpanKY.  I assure you no-one is
going to take SpanKY's keyboard(s) away from him *shudder*.

> The bug is:  http://bugs.gentoo.org/show_bug.cgi?id=139842
> 
> Executive Summary:  built_with_use returns the opposite answer to what
> it should, when the package referred to is not installed. I provided
> patches to stop that broken behaviour. People decided to talk about
> some mystical third state which doesn't exist in Boolean logic, and
> ended up convinced that black is white. And then proceeded to get
> themselves run over at the next Zebra crossing.

No, the value of built_with_use is meaningless when the package
referred to is not installed, so it doesn't matter whether it returns
true or false.  It could just die if the package is not installed, but
there's little point.  It's not a short-cut to calling has_version.  If
you want to find out if a package is installed as well as whether it
has a specific USE flag set, do:

has_version <pkg> && built_with_use <blah> && <dostuff>

Note that frequently built_with_use is called referring to packages in
DEPEND, where the has_version is unnecessary.

You want built_with_use to return FALSE when the package is not
installed.  Other cases would want it to return TRUE.  The correct
answer is that you should not call built_with_use until you know the
package is installed.

To put it into boolean logic, you want built_with_use to do:

  <installed> AND <USE=foo>

whereas others may want

  <installed> IMPLIES <USE=foo>


The correct answer is to use has_version to do the installed check,
built_with_use to do the USE=foo check and code the conjunction as
required.

-- 
Kevin F. Quinn

Attachment: signature.asc
Description: PGP signature

Reply via email to