Ticket #11891: deps.patch
File deps.patch, 6.8 KB (added by gwhitney@…, 18 years ago) |
---|
-
src/port/port.tcl
1131 1131 return 0 1132 1132 } 1133 1133 1134 1135 proc action_info { action portlist opts } { 1136 set status 0 1137 require_portlist portlist1138 foreachport $portlist {1134 # Helper for info and deps actions, which should both get the "true" port 1135 # info found by opening the port and thereby evaluating the variants 1136 proc obtain_port_info { porturl portname onlyindex varname} { 1137 upvar $varname variations 1138 global global_variations 1139 1139 # If we have a url, use that, since it's most specific 1140 1140 # otherwise try to map the portname to a url 1141 1141 if {$porturl eq ""} { 1142 1142 # Verify the portname, getting portinfo to map to a porturl 1143 1143 if {[catch {dportsearch $portname no exact} result]} { 1144 1144 ui_debug "$::errorInfo" 1145 break_softcontinue "search for portname $portname failed: $result" 1 status 1145 set portinfo(SignalError) "search for portname $portname failed: $result" 1146 return [array get portinfo] 1146 1147 } 1147 1148 if {[llength $result] < 2} { 1148 break_softcontinue "Port $portname not found" 1 status 1149 set portinfo(SignalError) "Port $portname not found" 1150 return [array get portinfo] 1149 1151 } 1150 1152 set found [expr [llength $result] / 2] 1151 1153 if {$found > 1} { … … 1156 1158 set porturl $portinfo(porturl) 1157 1159 set portdir $portinfo(portdir) 1158 1160 } 1159 1160 if {!([info exists options(ports_info_index)] && $options(ports_info_index) eq "yes")} { 1161 1162 # Add any global_variations to the variations 1163 # specified for the port 1164 foreach { variation value } [array get global_variations] { 1165 if { ![info exists variations($variation)] } { 1166 set variations($variation) $value 1167 } 1168 } 1169 1170 if {$onlyindex != "yes"} { 1161 1171 if {[catch {set dport [dportopen $porturl [array get options] [array get variations]]} result]} { 1162 1172 ui_debug "$::errorInfo" 1163 break_softcontinue "Unable to open port: $result" 1 status 1173 set portinfo(SignalError) "Unable to open port: $result" 1174 return [array get portinfo] 1164 1175 } 1165 1176 array unset portinfo 1166 1177 array set portinfo [dportinfo $dport] … … 1172 1183 ui_warn "port info --index does not work with 'current' pseudo-port" 1173 1184 continue 1174 1185 } 1175 1186 return [array get portinfo] 1187 } 1188 1189 proc action_info { action portlist opts } { 1190 set status 0 1191 require_portlist portlist 1192 foreachport $portlist { 1193 if {![info exists options(ports_info_index)]} { 1194 set options(ports_info_index) "no" 1195 } 1196 array unset portinfo 1197 array set portinfo [obtain_port_info $porturl $portname $options(ports_info_index) variations] 1198 if {[info exists portinfo(SignalError)]} { 1199 break_softcontinue $portinfo(SignalError) 1 status 1200 } 1176 1201 # Map from friendly to less-friendly but real names 1177 1202 array set name_map " 1178 1203 category categories … … 1258 1283 1259 1284 # If we weren't asked to show any specific fields, then show general information 1260 1285 puts -nonewline "$portinfo(name) $portinfo(version)" 1286 if {[info exists portinfo(portvariants)]} { 1287 puts -nonewline "$portinfo(portvariants)" 1288 } 1261 1289 if {[info exists portinfo(revision)] && $portinfo(revision) > 0} { 1262 1290 puts -nonewline ", Revision $portinfo(revision)" 1263 1291 } … … 1698 1726 1699 1727 1700 1728 proc action_deps { action portlist opts } { 1729 global variations global_variations 1701 1730 set status 0 1702 1731 require_portlist portlist 1703 1732 foreachport $portlist { 1704 # Get info about the port 1705 if {[catch {dportsearch $portname no exact} result]} { 1706 global errorInfo 1707 ui_debug "$errorInfo" 1708 break_softcontinue "search for portname $portname failed: $result" 1 status 1733 if {![info exists options(ports_deps_index)]} { 1734 set options(ports_deps_index) "no" 1709 1735 } 1710 1711 if {$result == ""} {1712 break_softcontinue "No port $portname found." 1 status1713 }1714 1715 1736 array unset portinfo 1716 array set portinfo [lindex $result 1] 1717 1737 array set portinfo [obtain_port_info $porturl $portname $options(ports_deps_index) variations] 1738 if {[info exists portinfo(SignalError)]} { 1739 break_softcontinue $portinfo(SignalError) 1 status 1740 } 1718 1741 set depstypes {depends_build depends_lib depends_run} 1719 1742 set depstypes_descr {"build" "library" "runtime"} 1720 1743 1744 if {[info exists portinfo(portvariants)]} { 1745 set fullportname "$portname $portinfo(portvariants)" 1746 } else { 1747 set fullportname $portname 1748 } 1721 1749 set nodeps true 1722 1750 foreach depstype $depstypes depsdecr $depstypes_descr { 1723 1751 if {[info exists portinfo($depstype)] && 1724 1752 $portinfo($depstype) != ""} { 1725 puts "$ portname has $depsdecr dependencies on:"1753 puts "$fullportname has $depsdecr dependencies on:" 1726 1754 foreach i $portinfo($depstype) { 1727 1755 puts "\t[lindex [split [lindex $i 0] :] end]" 1728 1756 } … … 1732 1760 1733 1761 # no dependencies found 1734 1762 if {$nodeps == "true"} { 1735 puts "$ portname has no dependencies"1763 puts "$fullportname has no dependencies" 1736 1764 } 1737 1765 } 1738 1766 -
src/darwinports1.0/darwinports.tcl
1354 1354 1355 1355 proc dportinfo {dport} { 1356 1356 set workername [ditem_key $dport workername] 1357 return [$workername eval array get PortInfo] 1357 array set pinfo [$workername eval array get PortInfo] 1358 if {[$workername eval info exists portvariants]} { 1359 set pinfo(portvariants) [$workername eval return \$portvariants] 1360 } 1361 return [array get pinfo] 1358 1362 } 1359 1363 1360 1364 proc dportclose {dport} { -
src/port1.0/portutil.tcl
1373 1373 } 1374 1374 1375 1375 proc variant_run {ditem} { 1376 global PortInfo 1376 1377 set name [ditem_key $ditem name] 1377 1378 ui_debug "Executing variant $name provides [ditem_key $ditem provides]" 1378 1379 … … 1391 1392 ui_error "Error executing $name: $result" 1392 1393 return 1 1393 1394 } 1395 # Update the long description to show that the variant is active 1396 if {[string first [option os.platform] $name] != 0 1397 && $name != [option os.arch] 1398 && [info exists PortInfo(long_description)]} { 1399 set terminator "." 1400 if {[info exists PortInfo(variant_desc)]} { 1401 array set descs $PortInfo(variant_desc) 1402 if {[info exists descs($name)]} { 1403 set terminator ": $descs($name)\n" 1404 } 1405 } 1406 set PortInfo(long_description) [concat $PortInfo(long_description) "\n(+$name active$terminator)\n"] 1407 } 1394 1408 return 0 1395 1409 } 1396 1410