[87281] trunk/base/src

jmr at macports.org jmr at macports.org
Tue Nov 15 23:44:39 PST 2011


Revision: 87281
          http://trac.macports.org/changeset/87281
Author:   jmr at macports.org
Date:     2011-11-15 23:44:36 -0800 (Tue, 15 Nov 2011)
Log Message:
-----------
set subport to the name as listed in the PortIndex when possible (#31743)

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/port/port.tcl
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2011-11-16 07:31:39 UTC (rev 87280)
+++ trunk/base/src/macports1.0/macports.tcl	2011-11-16 07:44:36 UTC (rev 87281)
@@ -2724,7 +2724,7 @@
                 } elseif {[info exists dep_portinfo(installs_libs)] && !$dep_portinfo(installs_libs)} {
                     set check_archs 0
                 }
-                lappend options subport $dep_portname
+                lappend options subport $dep_portinfo(name)
                 # Figure out the depport. Check the open_mports list first, since
                 # we potentially leak mport references if we mportopen each time,
                 # because mportexec only closes each open mport once.
@@ -3165,7 +3165,6 @@
 proc macports::_upgrade {portname dspec variationslist optionslist {depscachename ""}} {
     global macports::global_variations
     array set options $optionslist
-    set options(subport) $portname
 
     if {![string match "" $depscachename]} {
         upvar $depscachename depscache
@@ -3193,6 +3192,7 @@
     array set portinfo [lindex $result 1]
     # set portname again since the one we were passed may not have had the correct case
     set portname $portinfo(name)
+    set options(subport) $portname
 
     set ilist {}
     if { [catch {set ilist [registry::installed $portname ""]} result] } {

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2011-11-16 07:31:39 UTC (rev 87280)
+++ trunk/base/src/port/port.tcl	2011-11-16 07:44:36 UTC (rev 87281)
@@ -1051,7 +1051,7 @@
     set porturl $portinfo(porturl)
 
     # open portfile
-    if {[catch {set mport [mportopen $porturl [list subport $portname] [array get global_variations]]} result]} {
+    if {[catch {set mport [mportopen $porturl [list subport $portinfo(name)] [array get global_variations]]} result]} {
         ui_debug "$::errorInfo"
         return -code error "Unable to open port: $result"
     }
@@ -1097,7 +1097,7 @@
                     set porturl $portinfo(porturl)
                 
                     # open its portfile
-                    if {[catch {set mport [mportopen $porturl [list subport $depname] [array get global_variations]]} result]} {
+                    if {[catch {set mport [mportopen $porturl [list subport $portinfo(name)] [array get global_variations]]} result]} {
                         ui_debug "$::errorInfo"
                         ui_error "Unable to open port: $result"
                         continue
@@ -1886,6 +1886,7 @@
             set index_only 1
         }
         puts -nonewline $separator
+        array unset portinfo
         # If we have a url, use that, since it's most specific
         # otherwise try to map the portname to a url
         if {$porturl == "" || $index_only} {
@@ -1897,7 +1898,6 @@
             if {[llength $result] < 2} {
                 break_softcontinue "Port $portname not found" 1 status
             }
-            array unset portinfo
             array set portinfo [lindex $result 1]
             set porturl $portinfo(porturl)
             set portdir $portinfo(portdir)
@@ -1914,7 +1914,11 @@
                 } 
             }
             if {![info exists options(subport)]} {
-                set options(subport) $portname
+                if {[info exists portinfo(name)]} {
+                    set options(subport) $portinfo(name)
+                } else {
+                    set options(subport) $portname
+                }
             }
  
             if {[catch {set mport [mportopen $porturl [array get options] [array get merged_variations]]} result]} {
@@ -2239,6 +2243,7 @@
 
     set status 0
     foreachport $portlist {
+        array unset portinfo
         if {$porturl eq ""} {
             # Look up the port.
             if {[catch {mportlookup $portname} result]} {
@@ -2251,7 +2256,6 @@
             }
 
             # Retrieve the port's URL.
-            array unset portinfo
             array set portinfo [lindex $result 1]
             set porturl $portinfo(porturl)
         }
@@ -2266,7 +2270,11 @@
             } 
         }
         if {![info exists options(subport)]} {
-            set options(subport) $portname
+            if {[info exists portinfo(name)]} {
+                set options(subport) $portinfo(name)
+            } else {
+                set options(subport) $portname
+            }
         }
 
         # Open the Portfile associated with this port.
@@ -2716,7 +2724,8 @@
         } else {
             set deptypes {depends_fetch depends_extract depends_build depends_lib depends_run}
         }
-        
+
+        array unset portinfo
         # If we have a url, use that, since it's most specific
         # otherwise try to map the portname to a url
         if {$porturl eq ""} {
@@ -2728,7 +2737,6 @@
             if {[llength $result] < 2} {
                 break_softcontinue "Port $portname not found" 1 status
             }
-            array unset portinfo
             array set portinfo [lindex $result 1]
             set porturl $portinfo(porturl)
         } elseif {$porturl ne "file://."} {
@@ -2747,7 +2755,6 @@
             if {[llength $result] < 2} {
                 break_softcontinue "Portdir $portdir not found" 1 status
             }
-            array unset portinfo
             array set portinfo [lindex $result 1]
         }
 
@@ -2762,7 +2769,11 @@
                 } 
             }
             if {![info exists options(subport)]} {
-                set options(subport) $portname
+                if {[info exists portinfo(name)]} {
+                    set options(subport) $portinfo(name)
+                } else {
+                    set options(subport) $portname
+                }
             }
             if {[catch {set mport [mportopen $porturl [array get options] [array get merged_variations]]} result]} {
                 ui_debug "$::errorInfo"
@@ -2842,7 +2853,7 @@
                     array unset portinfo
                     array set portinfo [lindex $result 1]
                     set porturl $portinfo(porturl)
-                    set options(subport) $depname
+                    set options(subport) $portinfo(name)
                     
                     # open the portfile if requested
                     if {!([info exists options(ports_${action}_index)] && $options(ports_${action}_index) eq "yes")} {
@@ -3284,6 +3295,7 @@
         return 1
     }
     foreachport $portlist {
+        array unset portinfo
         if {$porturl eq ""} {
             # look up port
             if {[catch {mportlookup $portname} result]} {
@@ -3295,7 +3307,6 @@
                 break_softcontinue "Port $portname not found" 1 status
             }
 
-            array unset portinfo
             array set portinfo [lindex $result 1]
 
             set porturl $portinfo(porturl)
@@ -3304,7 +3315,11 @@
 
         if {!([info exists options(ports_variants_index)] && $options(ports_variants_index) eq "yes")} {
             if {![info exists options(subport)]} {
-                set options(subport) $portname
+                if {[info exists portinfo(name)]} {
+                    set options(subport) $portinfo(name)
+                } else {
+                    set options(subport) $portname
+                }
             }
             if {[catch {set mport [mportopen $porturl [array get options] [array get variations]]} result]} {
                 ui_debug "$::errorInfo"
@@ -3799,6 +3814,7 @@
         return 1
     }
     foreachport $portlist {
+        array unset portinfo
         # If we have a url, use that, since it's most specific
         # otherwise try to map the portname to a url
         if {$porturl == ""} {
@@ -3817,7 +3833,6 @@
                     break_softcontinue "Port $portname not found" 1 status
                 }
             }
-            array unset portinfo
             array set portinfo [lindex $res 1]
             set porturl $portinfo(porturl)
         }
@@ -3852,7 +3867,11 @@
             set target $action
         }
         if {![info exists options(subport)]} {
-            set options(subport) $portname
+            if {[info exists portinfo(name)]} {
+                set options(subport) $portinfo(name)
+            } else {
+                set options(subport) $portname
+            }
         }
         if {[catch {set workername [mportopen $porturl [array get options] [array get requested_variations]]} result]} {
             global errorInfo

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2011-11-16 07:31:39 UTC (rev 87280)
+++ trunk/base/src/port1.0/portutil.tcl	2011-11-16 07:44:36 UTC (rev 87281)
@@ -781,7 +781,7 @@
     if {![info exists PortInfo(subports)] || [lsearch -exact $PortInfo(subports) $subname] == -1} {
         lappend PortInfo(subports) $subname
     }
-    if {$subname == $subport} {
+    if {[string equal -nocase $subname $subport]} {
         set PortInfo(name) $subname
         uplevel 1 $body
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111115/cffd6333/attachment.html>


More information about the macports-changes mailing list