<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository mpbb.
</pre>
<p><a href="https://github.com/macports/mpbb/commit/3c8f133adfc7ed82251a9aaa2de6fe8e24eb66ff">https://github.com/macports/mpbb/commit/3c8f133adfc7ed82251a9aaa2de6fe8e24eb66ff</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 3c8f133 cleanup: correct check for inactive deps
</span>3c8f133 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 3c8f133adfc7ed82251a9aaa2de6fe8e24eb66ff
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Feb 16 11:11:55 2024 +1100
<span style='display:block; white-space:pre;color:#404040;'> cleanup: correct check for inactive deps
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> The dependencies registry key will return all installed versions of
</span><span style='display:block; white-space:pre;color:#404040;'> ports that a port depends on, and of course at most one can be active.
</span><span style='display:block; white-space:pre;color:#404040;'> Only deactivate if there is no active version of the dep.
</span>---
tools/uninstall-unneeded-ports.tcl | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tools/uninstall-unneeded-ports.tcl b/tools/uninstall-unneeded-ports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 4ff2c64..a7594f9 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/tools/uninstall-unneeded-ports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tools/uninstall-unneeded-ports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -160,9 +160,16 @@ foreach port [registry::entry imaged] {
</span> # Deactivate anything with inactive dependencies
# (can happen with non-port: deps)
# https://trac.macports.org/ticket/68662
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Track if each port has any version active
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# (ports may have multiple installed variants, e.g. universal)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set has_active [dict create]
</span> foreach port [registry::entry installed] {
foreach dep [$port dependencies] {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[$dep state] ne "installed"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![dict exists $has_active [$dep name]]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ dict set has_active [$dep name] [expr {[registry::entry installed [$dep name]] ne ""}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![dict get $has_active [$dep name]]} {
</span> ui_msg "Deactivating [$port name] because its dependency [$dep name] is not active"
deactivate_with_dependents $port
break
</pre><pre style='margin:0'>
</pre>