Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #16336: base_src_macports1.0_macports.tcl.diff

File base_src_macports1.0_macports.tcl.diff, 2.9 KB (added by blb@…, 5 months ago)

diff to base/src/macports1.0/macports.tcl

  • base/src/macports1.0/macports.tcl

    old new  
    17151715    foreach depspec $depends { 
    17161716        # grab the portname portion of the depspec 
    17171717        set dep_portname [lindex [split $depspec :] end] 
    1718          
    1719         # Find the porturl 
    1720         if {[catch {set res [mportsearch $dep_portname false exact]} error]} { 
    1721             global errorInfo 
    1722             ui_debug "$errorInfo" 
    1723             ui_error "Internal error: port search failed: $error" 
    1724             return 1 
    1725         } 
    1726          
    1727         unset -nocomplain porturl 
    1728         foreach {name array} $res { 
    1729             array set portinfo $array 
    1730             if {[info exists portinfo(porturl)]} { 
    1731                 set porturl $portinfo(porturl) 
     1718 
     1719        unset -nocomplain firstchoice 
     1720        foreach {dep_portname_choice} [split $dep_portname |] { 
     1721            if {![info exists firstchoice]} { 
     1722                set firstchoice $dep_portname_choice 
     1723            } 
     1724            # Find the porturl 
     1725            if {[catch {set res [mportsearch $dep_portname_choice false exact]} error]} { 
     1726                global errorInfo 
     1727                ui_debug "$errorInfo" 
     1728                ui_error "Internal error: port search failed: $error" 
     1729                return 1 
     1730            } 
     1731             
     1732            unset -nocomplain porturl 
     1733            foreach {name array} $res { 
     1734                array set portinfo $array 
     1735                if {[info exists portinfo(porturl)]} { 
     1736                    set porturl $portinfo(porturl) 
     1737                    break 
     1738                } 
     1739            } 
     1740     
     1741            if {![info exists porturl]} { 
     1742                ui_error "Dependency '$dep_portname_choice' not found." 
     1743                return 1 
     1744            } 
     1745     
     1746            set options [ditem_key $mport options] 
     1747            set variations [ditem_key $mport variations] 
     1748     
     1749            # Figure out the subport.    
     1750            set subport [mportopen $porturl $options $variations] 
     1751            if {[_mportispresent $subport $depspec]} { 
    17321752                break 
     1753            } else { 
     1754                mportclose $subport 
     1755                unset subport 
    17331756            } 
    17341757        } 
    17351758 
    1736         if {![info exists porturl]} { 
    1737             ui_error "Dependency '$dep_portname' not found." 
    1738             return 1 
     1759        if {![info exists subport]} { 
     1760            array set firstchoiceinfo [lindex [mportsearch $firstchoice false exact] 1] 
     1761            set subport [mportopen $firstchoiceinfo(porturl) $options $variations] 
    17391762        } 
    17401763 
    1741         set options [ditem_key $mport options] 
    1742         set variations [ditem_key $mport variations] 
    1743  
    1744         # Figure out the subport.    
    1745         set subport [mportopen $porturl $options $variations] 
    1746  
    17471764        # Is that dependency satisfied or this port installed? 
    17481765        # If we don't skip or if it is not, add it to the list. 
    17491766        if {!$skipSatisfied || ![_mportispresent $subport $depspec]} {