<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/e4fce5fae006832b5d2d8f182510f8f58d13090e">https://github.com/macports/macports-base/commit/e4fce5fae006832b5d2d8f182510f8f58d13090e</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit e4fce5fae006832b5d2d8f182510f8f58d13090e
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Tue Feb 6 14:35:10 2024 +1100

<span style='display:block; white-space:pre;color:#404040;'>    Adopt dict in action_portcmds
</span>---
 src/port/port.tcl | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 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 828214a99..d975fb6ff 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;'>@@ -3616,14 +3616,12 @@ proc action_echo { action portlist opts } {
</span> 
 proc action_portcmds { action portlist opts } {
     # Operations on the port's directory and Portfile
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global env boot_env current_portdir
</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>         # If we have a url, use that, since it's most specific, otherwise try to map the portname to a url
         if {$porturl eq ""} {
 
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3635,9 +3633,8 @@ proc action_portcmds { action portlist opts } {
</span>             if {[llength $res] < 2} {
                 break_softcontinue "Port $portname not found" 1 status
             }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            array set portinfo [lindex $res 1]
</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 portname $portinfo(name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            lassign $res portname portinfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            set porturl [dict get $portinfo porturl]
</span>         }
 
 
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3664,6 +3661,7 @@ proc action_portcmds { action portlist opts } {
</span>                     # Restore our entire environment from start time.
                     # We need it to evaluate the editor, and the editor
                     # may want stuff from it as well, like TERM.
<span style='display:block; white-space:pre;background:#e0ffe0;'>+                    global env boot_env
</span>                     set env_save [array get env]
                     array unset env *
                     array set env $boot_env
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3712,7 +3710,7 @@ proc action_portcmds { action portlist opts } {
</span>                 cd {
                     # Change to the port's directory, making it the default
                     # port for any future commands
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                    set current_portdir $portdir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    set ::current_portdir $portdir
</span>                 }
 
                 url {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3738,15 +3736,15 @@ proc action_portcmds { action portlist opts } {
</span>                     set homepage ""
 
                     # Get the homepage as read from PortIndex
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                    if {[info exists portinfo(homepage)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        set homepage $portinfo(homepage)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    if {[dict exists $portinfo homepage]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set homepage [dict get $portinfo homepage]
</span>                     }
 
                     # If not available, get the homepage for the port by opening the Portfile
                     if {$homepage eq "" && ![catch {set ctx [mportopen $porturl]} result]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                        array set portinfo [mportinfo $ctx]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                        if {[info exists portinfo(homepage)]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                            set homepage $portinfo(homepage)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set portinfo [dict merge $portinfo [mportinfo $ctx]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        if {[dict exists $portinfo homepage]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            set homepage [dict get $portinfo homepage]
</span>                         }
                         mportclose $ctx
                     }
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3772,10 +3770,8 @@ proc action_portcmds { action portlist opts } {
</span> 
 
 proc action_sync { action portlist opts } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    global global_options
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span>     set status 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    if {[catch {mportsync [array get global_options]} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if {[catch {mportsync [array get ::global_options]} result]} {
</span>         ui_debug $::errorInfo
         ui_msg "port sync failed: $result"
         set status 1
</pre><pre style='margin:0'>

</pre>