| 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]} { |