<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/a14d0495d9b889caa8f0ef2cc0086e01bf75787f">https://github.com/macports/macports-base/commit/a14d0495d9b889caa8f0ef2cc0086e01bf75787f</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit a14d0495d9b889caa8f0ef2cc0086e01bf75787f
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sun Feb 18 17:19:38 2024 +1100
<span style='display:block; white-space:pre;color:#404040;'> Use dict in mportopen_installed
</span>---
src/macports1.0/macports.tcl | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 890e96e8d..cdf64c3a4 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2111,23 +2111,22 @@ proc mportopen_installed {name version revision variants options} {
</span> set regref [lindex [registry::entry imaged $name $version $revision $variants] 0]
set portfile_dir [file join ${registry.path} registry portfiles ${name}-${version}_${revision} [$regref portfile]]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set variations [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set variations [dict create]
</span> # Relies on all negated variants being at the end of requested_variants
set minusvariant [lrange [split [$regref requested_variants] -] 1 end]
set plusvariant [lrange [split [$regref variants] +] 1 end]
foreach v $plusvariant {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend variations $v +
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set variations $v +
</span> }
foreach v $minusvariant {
if {[string first "+" $v] == -1} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend variations $v -
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set variations $v -
</span> } else {
ui_warn "Invalid negated variant for $name @${version}_${revision}${variants}: $v"
}
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- array set options_array $options
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set options_array(subport) $name
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set options subport $name
</span>
# find portgroups in registry
set pgdirlist [list]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2136,14 +2135,14 @@ proc mportopen_installed {name version revision variants options} {
</span> registry::portgroup close $pg
}
if {$pgdirlist ne ""} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set options_array(_portgroup_search_dirs) $pgdirlist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set options _portgroup_search_dirs $pgdirlist
</span> }
# Don't close as the reference is usually in use by the caller.
# (Maybe this proc should take a regref as input?)
#registry::entry close $regref
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set retmport [mportopen file://${portfile_dir}/ [array get options_array] $variations]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set retmport [mportopen file://${portfile_dir}/ $options $variations]
</span> set workername [ditem_key $retmport workername]
foreach var {version revision variants} {
$workername eval [list set _inregistry_${var} [set $var]]
</pre><pre style='margin:0'>
</pre>