<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/6446a0370a9322377a296ede7e2535b00c8ac556">https://github.com/macports/macports-base/commit/6446a0370a9322377a296ede7e2535b00c8ac556</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 6446a0370 Use registry2 in get_leaves_ports, get_rleaves_ports
</span>6446a0370 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 6446a0370a9322377a296ede7e2535b00c8ac556
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Thu Feb 8 02:15:43 2024 +1100
<span style='display:block; white-space:pre;color:#404040;'> Use registry2 in get_leaves_ports, get_rleaves_ports
</span>---
src/port/port.tcl | 33 ++++++++++-----------------------
1 file changed, 10 insertions(+), 23 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 208bde321..5d6fa4310 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;'>@@ -653,46 +653,33 @@ proc get_unrequested_ports {} {
</span> }
proc get_leaves_ports {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set ilist [list]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if { [catch {set ilist [registry::installed]} result] } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$result ne "Registry error: No ports registered as installed."} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug $::errorInfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fatal "port installed failed: $result"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {set ilist [registry::entry imaged]} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_debug $::errorInfo
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fatal "getting installed ports failed: $result"
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- registry::open_dep_map
</span> set results [list]
foreach i $ilist {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set iname [lindex $i 0]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[registry::list_dependents $iname] eq ""} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- add_to_portlist_with_defaults results [dict create name $iname version "[lindex $i 1]_[lindex $i 2]" variants [split_variants [lindex $i 3]]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[$i dependents] eq ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_to_portlist_with_defaults results [dict create name [$i name] version [$i version]_[$i revision] variants [split_variants [$i variants]]]
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return [portlist_sort [opIntersection $results [get_unrequested_ports]]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [portlist_sort [opComplement $results [get_requested_ports]]]
</span> }
proc get_rleaves_ports {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if { [catch {set ilist [get_unrequested_ports]} result] } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$result ne "Registry error: No ports registered as installed."} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug $::errorInfo
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- fatal "port installed failed: $result"
</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:#ffe0e0;'>- registry::open_dep_map
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ilist [get_unrequested_ports]
</span> set requested [get_requested_ports]
set results [list]
foreach i $ilist {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set iname [lindex $i 9]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set deplist [get_dependent_ports $iname 1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set deplist [get_dependent_ports [dict get $i name] 1]
</span> if {$deplist eq "" || [opIntersection $deplist $requested] eq ""} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- add_to_portlist_with_defaults results $i
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_to_portlist results $i
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return [portlist_sort $results]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $results
</span> }
proc get_dependent_ports {portname recursive} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- registry::open_dep_map
</span> set deplist [registry::list_dependents $portname]
# could return specific versions here using registry2.0 features
set results [list]
</pre><pre style='margin:0'>
</pre>