On Thu, 7 Jul 2005 11:17:48 -0400
Mike Frysinger <[EMAIL PROTECTED]> wrote:

> the only argument ive heard against using || ( ) is binary
> packages due to the 'accept any' nature of || ( )

There are issues that don't affect only binary package but also
from-sources installation. The example was:
 || ( sdl? ( media-libs/libsdl )
      svga? ( media-libs/svgalib )
      opengl? ( virtual/opengl )
      ggi? ( media-libs/libggi )
      virtual/x11
 )

First problem is that if a user has just added 'sdl' to his USE
flags, don't have SDL installed yet, but have Xorg already
installed, this deps won't make SDL to install. That's probably
not what he would have expect.

Second problem is that in src_compile, USE flags give no clue
about what optionnal deps are satisfied. If for instance the
program is a game with several make targets, this will break,
because SDL may not be installed:
    if use sdl ; then
        emake game.sdl || die
    elif use ...

Thus, the src_compile should use some has_version instead:
    if has_version media-lib/sdl ; then
        emake game.sdl || die
    elif has_version ...

It works, but is ugly, and kill the usefulness of USE flags (no
chance to force the game to build against svga for instance if
both SDL and svgalib are installed).

So yes, in such a case i think it's much better to make the
depend string determinisc. I would not write it exactly the way
twofourtysix did tho (no need to have the !flag several times):
    sdl? ( media-libs/libsdl )
    !sdl? ( svga? ( media-libs/svgalib )
            !svga? ( opengl? ( virtual/opengl )
                     !opengl? ( ...

(with lot of closing parenthesis at the end. )

--
TGL.
-- 
gentoo-dev@gentoo.org mailing list

Reply via email to