<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/d27484c630ca98409cfcc71e4abd9ae2ae6c1696">https://github.com/macports/macports-base/commit/d27484c630ca98409cfcc71e4abd9ae2ae6c1696</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 d27484c63 registry_installed: resolve ambiguity interactively
</span>d27484c63 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit d27484c630ca98409cfcc71e4abd9ae2ae6c1696
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sat Aug 10 05:27:34 2024 +1000
<span style='display:block; white-space:pre;color:#404040;'> registry_installed: resolve ambiguity interactively
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/70514
</span>---
src/port/port.tcl | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 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 bb70731dd..56b2e27dc 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;'>@@ -169,17 +169,28 @@ proc registry_installed {portname {portversion ""} {require_single yes} {only_ac
</span> }
if {[llength $matches] > 1} {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ global macports::ui_options
</span> # set portname again since the one we were passed may not have had the correct case
set portname [[lindex $matches 0] name]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_notice "The following versions of $portname are currently installed:"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set msg "The following versions of $portname are currently installed:"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portilist [list]
</span> foreach i $matches {
if {[$i state] eq "installed"} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts " $portname @[$i version]_[$i revision][$i variants] (active)"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend portilist " $portname @[$i version]_[$i revision][$i variants] (active)"
</span> } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts " $portname @[$i version]_[$i revision][$i variants]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend portilist " $portname @[$i version]_[$i revision][$i variants]"
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error "Registry error: Please specify the full version as recorded in the port registry."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists ui_options(questions_singlechoice)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set retindex [$macports::ui_options(questions_singlechoice) $msg "Choice_Q1" $portilist]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [lindex $matches $retindex]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_notice $msg
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach portstr $portilist {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $portstr
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "Registry error: Please specify the full version as recorded in the port registry."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> } elseif {[llength $matches] == 0} {
if {$portversion eq ""} {
return -code error "Registry error: $portname not registered as installed."
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2202,15 +2213,17 @@ proc action_activate { action portlist opts } {
</span> }
foreachport $portlist {
set composite_version [composite_version $portversion $variations]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![dict exists $options ports_activate_no-exec]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- && ![catch {registry_installed $portname $composite_version} regref]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[$regref installtype] eq "image" && [registry::run_target $regref activate $options]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- continue
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {registry_installed $portname $composite_version} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break_softcontinue "port activate failed: $result" 1 status
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set regref $result
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![dict exists $options ports_activate_no-exec] &&
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [registry::run_target $regref activate $options]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } then {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue
</span> }
if {![macports::global_option_isset ports_dryrun]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if { [catch {portimage::activate_composite $portname $composite_version $options} result] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {portimage::activate_composite $portname $composite_version $options} result]} {
</span> ui_debug $::errorInfo
break_softcontinue "port activate failed: $result" 1 status
}
</pre><pre style='margin:0'>
</pre>