On Thu, 22 Feb 2007 22:02:27 +0100 Simon Stelling <[EMAIL PROTECTED]>
wrote:
| Ciaran McCreesh wrote:
| >     || (
| >         sdl? ( media-libs/libsdl )    
| >         svga? ( media-libs/svgalib )
| >         opengl? ( virtual/opengl )
| >         ggi? ( media-libs/libggi )
| >         virtual/x
| >     )
| 
| It's doable with just use. For the example above, this would be the
| solution:
| 
| interface="x11"
| use ggi && interface="ggi"
| use opengl && interface="opengl"
| use svgalib && interface="svga"
| use sdl && interface="libsdl"

I'll explain why this doesn't work for the benefit of anyone who misses
it...

Consider the user having USE="sdl svgalib", and already having svgalib
installed. Then sdl will not be pulled in, and the above solution will
give the wrong interface.

| > So, is there a legitimate reason for this complication to exist? Or
| > should use? blocks being direct children of || ( ) be forbidden?
| 
| I don't see how this is a complication, tbh. The alternative would be
| to have the same DEPEND but without the ||(). But then you would have
| to a) let the ebuild die if more then one flag is turned on or b)
| have it follow the same logic as shown above.
| 
| I also don't see how it is a nuisance to explain. Explain how ||()
| works with a "normal" dependency, explain how use? () dependencies
| work and it will become clear to everybody how it will work. TBH, it
| looks to me like you were to explain how an if statement in a while
| loop works, even though it is well-known how both of them work if
| they aren't nested.

Except that that's not what happens. The current behaviour makes if
work differently if it's a direct child of a while loop. The following
are not equivalent:

    || ( foo? ( bar/foo ) bar/baz )

    || ( ( foo? ( bar/foo ) ) bar/baz )

The former will always require either foo or baz, whereas the latter
will sometimes require neither.

-- 
Ciaran McCreesh
Mail                                : ciaranm at ciaranm.org
Web                                 : http://ciaranm.org/
Paludis, the secure package manager : http://paludis.pioto.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to