<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/72a5698142c57eb87249de2f0693ad1df8889e48">https://github.com/macports/macports-base/commit/72a5698142c57eb87249de2f0693ad1df8889e48</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 72a5698142c57eb87249de2f0693ad1df8889e48
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Feb 16 01:10:57 2024 +1100
<span style='display:block; white-space:pre;color:#404040;'> diagnose: improve check_port_files
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Give variables more accurate names. Only ask the registry for active
</span><span style='display:block; white-space:pre;color:#404040;'> ports instead of filtering out the inactive ones afterwards. Use a dict
</span><span style='display:block; white-space:pre;color:#404040;'> for the mapping between port names and file lists.
</span>---
src/macports1.0/diagnose.tcl | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/diagnose.tcl b/src/macports1.0/diagnose.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 134e73a3d..87fa5758d 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/diagnose.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/diagnose.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -361,18 +361,16 @@ namespace eval diagnose {
</span> # None
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set apps [registry::entry imaged]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set activePorts [registry::entry installed]
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- array set activeApps {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set filesForPorts [dict create]
</span> set totalFiles 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach app $apps {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set files [$app files]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[$app state] eq "installed"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set activeApps([$app name]) $files
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- incr totalFiles [llength $files]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #registry::entry close $app
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach port $activePorts {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set files [$port files]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set filesForPorts [$port name] $files
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ incr totalFiles [llength $files]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #registry::entry close $port
</span> }
set fancyOutput [expr { ![macports::ui_isset ports_debug] \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -395,8 +393,8 @@ namespace eval diagnose {
</span> }
set currentFile 1
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach name [lsort [array names activeApps]] {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach file $activeApps($name) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach name [lsort [dict keys $filesForPorts]] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach file [dict get $filesForPorts $name] {
</span> if {$fancyOutput} {
$progress update $currentFile $totalFiles
} else {
</pre><pre style='margin:0'>
</pre>