Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 46005

Summary: The ?: syntax cannot be deprecated yet
Product: Portage Development Reporter: Karl Trygve Kalleberg (RETIRED) <karltk>
Component: Core - DependenciesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: mr_bones_
Priority: High    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---

Description Karl Trygve Kalleberg (RETIRED) gentoo-dev 2004-03-28 10:15:07 UTC
The "old" foo? ( cat/pkg1 ) : ( cat/pkg2 ) syntax cannot safely be deprecated yet, as the implementation of the replacement syntax || ( foo? ( cat/pkg1 ) cat/pkg2 ) is not semantically identical.

Example can be found in dev-util/eclipse-sdk-2.1.3, where I currently have:
        gtk? ( >=x11-libs/gtk+-2.4 ) :
        ( kde? ( kde-base/kde x11-libs/openmotif ) :
          ( motif? ( x11-libs/openmotif ) :
            ( >=x11-libs/gtk+-2.4 )
          )
        )
Which according to the manual should be the same as:
       || (
           gtk? ( >=x11-libs/gtk+-2.4 )
           kde? ( kde-base/kde x11-libs/openmotif )
           motif? ( x11-libs/openmotif )
           >=x11-libs/gtk+-2.4
       )

However, on my machine, running portage-2.0.50-r1, they are not. If I specify both kde and gtk with the latter syntax, the gtk dependencies will not be installed, whereas they will be preferred in the first case. 

The funny thing is that I have all deps already installed for the kde case, but I don't have gtk+-2.4. If I add a non-installed dep in the kde case, it will suddenly prefer the gtk case, as I want.

Apparently, portage will first select the option that results in the fewest merges, then it will select in order of appearance in the || () list. Shouldn't it be other way around?
Comment 1 SpanKY gentoo-dev 2004-03-28 10:48:54 UTC
gtk? ( >=x11-libs/gtk+-2.4 )
!gtk? (
    kde? ( kde-base/kde x11-libs/openmotif )
    !kde? ( ... )
)

although the || ( ) should have worked ...
Comment 2 Marius Mauch (RETIRED) gentoo-dev 2004-06-09 20:08:47 UTC
still valid ?
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2004-06-09 23:58:48 UTC
This syntax doesn't appear in any ebuilds in portage at this time.
Comment 4 Brian Harring (RETIRED) gentoo-dev 2005-02-28 00:23:59 UTC
Nuking this.