<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.

</pre>
<p><a href="https://github.com/macports/macports-base/commit/a8b603d1be2f316b6257c3a00bc24794482286d0">https://github.com/macports/macports-base/commit/a8b603d1be2f316b6257c3a00bc24794482286d0</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'>     new a8b603d1b port.tcl: adopt dict through to action_variants
</span>a8b603d1b is described below

<span style='display:block; white-space:pre;color:#808000;'>commit a8b603d1be2f316b6257c3a00bc24794482286d0
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Mon Feb 5 20:49:42 2024 +1100

<span style='display:block; white-space:pre;color:#404040;'>    port.tcl: adopt dict through to action_variants
</span>---
 src/port/port.tcl | 107 ++++++++++++++++++++----------------------------------
 1 file changed, 39 insertions(+), 68 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port/port.tcl b/src/port/port.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 81fbb4b48..a4cb29852 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port/port.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port/port.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2979,12 +2979,11 @@ proc action_uninstall { action portlist opts } {
</span> 
 
 proc action_installed { action portlist opts } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global private_options
</span>     set status 0
     set restrictedList 0
     set ilist [list]
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    if { [llength $portlist] || (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) eq "no")} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if { [llength $portlist] || (![info exists ::private_options(ports_no_args)] || $::private_options(ports_no_args) eq "no")} {
</span>         set restrictedList 1
         foreachport $portlist {
             set composite_version [composite_version $portversion $variations]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3050,18 +3049,16 @@ proc action_installed { action portlist opts } {
</span> 
 
 proc action_outdated { action portlist opts } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global private_options
</span>     set status 0
 
     # If port names were supplied, limit ourselves to those ports, else check all installed ports
     set ilist [list]
     set restrictedList 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    if { [llength $portlist] || (![info exists private_options(ports_no_args)] || $private_options(ports_no_args) eq "no")} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if { [llength $portlist] || (![info exists ::private_options(ports_no_args)] || $::private_options(ports_no_args) eq "no")} {
</span>         set restrictedList 1
         foreach portspec $portlist {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            array set port $portspec
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            set portname $port(name)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            set composite_version [composite_version $port(version) $port(variants)]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set portname [dict get $portspec name]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set composite_version [composite_version [dict get $portspec version] [dict get $portspec variants]]
</span>             if { [catch {set ilist [concat $ilist [registry::installed $portname $composite_version]]} result] } {
                 if {![string match "* not registered as installed." $result]} {
                     ui_debug $::errorInfo
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3106,23 +3103,22 @@ proc action_outdated { action portlist opts } {
</span>                 }
                 continue
             }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            array unset portinfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            array set portinfo [lindex $res 1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            lassign $res portname portinfo
</span> 
             # Get information about latest available version and revision
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {![info exists portinfo(version)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            if {![dict exists $portinfo version]} {
</span>                 ui_warn "$portname has no version field"
                 continue
             }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            set latest_version $portinfo(version)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set latest_version [dict get $portinfo version]
</span>             set latest_revision 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {[info exists portinfo(revision)] && $portinfo(revision) > 0} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                set latest_revision $portinfo(revision)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            if {[dict exists $portinfo revision] && [dict get $portinfo revision] > 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                set latest_revision [dict get $portinfo revision]
</span>             }
             set latest_compound "${latest_version}_${latest_revision}"
             set latest_epoch 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {[info exists portinfo(epoch)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                set latest_epoch $portinfo(epoch)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            if {[dict exists $portinfo epoch]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                set latest_epoch [dict get $portinfo epoch]
</span>             }
 
             # Compare versions, first checking epoch, then version, then revision
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3201,14 +3197,13 @@ proc action_outdated { action portlist opts } {
</span> 
 
 proc action_contents { action portlist opts } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global global_options
</span>     if {[require_portlist portlist]} {
         return 1
     }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    if {[info exists global_options(ports_contents_size)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if {[info exists ::global_options(ports_contents_size)]} {
</span>         set units {}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        if {[info exists global_options(ports_contents_units)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            set units [complete_size_units $global_options(ports_contents_units)]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {[info exists ::global_options(ports_contents_units)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set units [complete_size_units $::global_options(ports_contents_units)]
</span>         }
         set outstring {[format "%12s $file" [filesize $file $units]]}
     } else {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3260,12 +3255,11 @@ proc complete_size_units {units} {
</span> 
 # Show space used by the given ports' files
 proc action_space {action portlist opts} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global global_options
</span>     require_portlist portlist
 
     set units {}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    if {[info exists global_options(ports_space_units)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        set units [complete_size_units $global_options(ports_space_units)]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if {[info exists ::global_options(ports_space_units)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set units [complete_size_units $::global_options(ports_space_units)]
</span>     }
     set spaceall 0.0
     foreachport $portlist {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3300,13 +3294,12 @@ proc action_space {action portlist opts} {
</span> }
 
 proc action_variants { action portlist opts } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global global_variations
</span>     set status 0
     if {[require_portlist portlist]} {
         return 1
     }
     foreachport $portlist {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        array unset portinfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set portinfo ""
</span>         if {$porturl eq ""} {
             # look up port
             if {[catch {mportlookup $portname} result]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3317,87 +3310,65 @@ proc action_variants { action portlist opts } {
</span>                 break_softcontinue "Port $portname not found" 1 status
             }
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            array set portinfo [lindex $result 1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            lassign $result portname portinfo
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            set porturl $portinfo(porturl)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            set portdir $portinfo(portdir)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set porturl [dict get $portinfo porturl]
</span>         }
 
         if {!([dict exists $options ports_variants_index] && [dict get $options ports_variants_index] eq "yes")} {
             # Add any global_variations to the variations specified for
             # the port (default variants may change based on this)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            array unset merged_variations
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            array set merged_variations $variations
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            foreach {variation value} [array get global_variations] {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                if {![info exists merged_variations($variation)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    set merged_variations($variation) $value
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set merged_variations [dict merge [array get ::global_variations] $variations]
</span>             if {![dict exists $options subport]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                if {[info exists portinfo(name)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    dict set options subport $portinfo(name)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    dict set options subport $portname
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                dict set options subport $portname
</span>             }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {[catch {set mport [mportopen $porturl $options [array get merged_variations]]} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            if {[catch {set mport [mportopen $porturl $options $merged_variations]} result]} {
</span>                 ui_debug "$::errorInfo"
                 break_softcontinue "Unable to open port: $result" 1 status
             }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            array unset portinfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            array set portinfo [mportinfo $mport]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set portinfo [dict merge $portinfo [mportinfo $mport]]
</span>             mportclose $mport
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {[info exists portdir]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                set portinfo(portdir) $portdir
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        } elseif {![info exists portinfo]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        } elseif {$portinfo eq ""} {
</span>             ui_warn "port variants --index does not work with 'current' pseudo-port"
             continue
         }
 
         # set portname again since the one we were passed may not have had the correct case
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        set portname $portinfo(name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        set portname [dict get $portinfo name]
</span> 
         # if this fails the port doesn't have any variants
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        if {![info exists portinfo(variants)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {![dict exists $portinfo variants]} {
</span>             ui_notice "$portname has no variants"
         } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            array unset vinfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            # Use the variant info if it exists.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            if {[info exists portinfo(vinfo)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                array set vinfo $portinfo(vinfo)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span>             # print out all the variants
             ui_notice "$portname has the variants:"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            foreach v [lsort $portinfo(variants)] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            foreach v [lsort [dict get $portinfo variants]] {
</span>                 unset -nocomplain vconflicts vdescription vrequires
                 set varmodifier "   "
                 # Retrieve variants' information from the new format.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                if {[info exists vinfo]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    array unset variant
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    array set variant $vinfo($v)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                if {[dict exists $portinfo vinfo $v]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    set variant [dict get $portinfo vinfo $v]
</span> 
                     # Retrieve conflicts, description, is_default, and
                     # vrequires.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                    if {[info exists variant(conflicts)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        set vconflicts $variant(conflicts)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    if {[dict exists $variant conflicts]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set vconflicts [dict get $variant conflicts]
</span>                     }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                    if {[info exists variant(description)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        set vdescription $variant(description)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    if {[dict exists $variant description]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set vdescription [dict get $variant description]
</span>                     }
 
                     # XXX Keep these varmodifiers in sync with action_info, or create a wrapper for it
                     if {[dict exists $variations $v]} {
                         set varmodifier "  [dict get $variations $v]"
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                    } elseif {[info exists global_variations($v)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    } elseif {[info exists ::global_variations($v)]} {
</span>                         # selected by variants.conf, prefixed with (+)/(-)
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                        set varmodifier "($global_variations($v))"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    } elseif {[info exists variant(is_default)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        set varmodifier "\[$variant(is_default)\]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set varmodifier "($::global_variations($v))"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    } elseif {[dict exists $variant is_default]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set varmodifier "\[[dict get $variant is_default]\]"
</span>                     }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                    if {[info exists variant(requires)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        set vrequires $variant(requires)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    if {[dict exists $variant requires]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set vrequires [dict get $variant requires]
</span>                     }
                 }
 
</pre><pre style='margin:0'>

</pre>