<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/980a5c1e1cefd818b7000b88e2911781d7ad9c6d">https://github.com/macports/macports-base/commit/980a5c1e1cefd818b7000b88e2911781d7ad9c6d</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 980a5c1e1cefd818b7000b88e2911781d7ad9c6d
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Mon Oct 30 07:39:42 2023 +1100
<span style='display:block; white-space:pre;color:#404040;'> _upgrade: fix possible error doing dependents
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Avoid using registry entries that could potentially have been
</span><span style='display:block; white-space:pre;color:#404040;'> uninstalled since they were obtained.
</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/66186
</span>---
src/macports1.0/macports.tcl | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 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 133ca83a6..6e07ed3a5 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;'>@@ -4179,6 +4179,9 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
</span> if {[catch {$regref cxx_stdlib_overridden} cxx_stdlib_overridden]} {
set cxx_stdlib_overridden 0
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists options(ports_do_dependents)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set dependents_list [$regref dependents]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span>
# Before we do
# dependencies, we need to figure out the final variants,
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4371,10 +4374,13 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
</span> # We do dependents ..
set options(ports_nodeps) 1
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set deplist [$regref dependents]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach dep $deplist {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set mpname [$dep name]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Get names from all registry entries in advance, since the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # recursive upgrade calls could invalidate them.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set dependents_names [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach dep $dependents_list {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend dependents_names [$dep name]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach mpname $dependents_names {
</span> if {![info exists depscache(port:$mpname)]} {
set status [macports::_upgrade $mpname port:$mpname $variationslist [array get options] depscache]
if {$status != 0 && $status != 2 && ![ui_isset ports_processall]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4533,14 +4539,16 @@ proc macports::_upgrade {portname dspec variationslist optionslist {depscachenam
</span> if {![info exists newregref]} {
set newregref [registry::entry open $newname $version_in_tree $revision_in_tree $portinfo(canonical_active_variants) ""]
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set deplist [$newregref dependents]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set deplist [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend dependents_list {*}[$newregref dependents]
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set deplist [concat $deplist [$regref dependents]]
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach dep $deplist {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set mpname [$dep name]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Get names from all registry entries in advance, since the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # recursive upgrade calls could invalidate them.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set dependents_names [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach dep $dependents_list {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend dependents_names [$dep name]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach mpname $dependents_names {
</span> if {![info exists depscache(port:$mpname)]} {
set status [macports::_upgrade $mpname port:$mpname $variationslist [array get options] depscache]
if {$status != 0 && $status != 2 && ![ui_isset ports_processall]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5443,7 +5451,7 @@ proc macports::revupgrade_scanandrebuild {broken_port_counts_name opts} {
</span> array set visited {}
foreach port $broken_ports {
# stack of broken nodes we've come across
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set stack {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set stack [list]
</span> lappend stack $port
# build graph
</pre><pre style='margin:0'>
</pre>