<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch release-2.10
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/7d7551dcce5efcc9553ddff33efe00fec34c8898">https://github.com/macports/macports-base/commit/7d7551dcce5efcc9553ddff33efe00fec34c8898</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 7d7551dcce5efcc9553ddff33efe00fec34c8898
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Wed Jul 24 08:31:20 2024 +1000
<span style='display:block; white-space:pre;color:#404040;'> restore: report failures for installed ports too
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Just because it's installed doesn't mean there wasn't a failure that
</span><span style='display:block; white-space:pre;color:#404040;'> prevented it from being activated.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> (cherry picked from commit 07f7efe621e36966461aa4737df8ce702dc97d44)
</span>---
src/macports1.0/restore.tcl | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/restore.tcl b/src/macports1.0/restore.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index f24e110f9..77a5981b8 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/restore.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/restore.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -168,9 +168,48 @@ namespace eval restore {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[llength $diff(changed)] > 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # It's possible that a port's state changed because it failed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # to activate, or it's a platform-independent port that stayed
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # installed but a dependency failed. Report that separately.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set changed_and_failed {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set just_changed {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach changed_port $diff(changed) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set name [lindex $changed_port 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $failed $name]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend changed_and_failed $changed_port
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend just_changed $changed_port
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[llength $changed_and_failed] > 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append note "The following ports could not be fully restored:\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach changed_port [lsort -ascii -index 0 $changed_and_failed] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lassign $changed_port name _ _ _ requested_variants changes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$requested_variants ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append note " - $name\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append note " - $name $requested_variants\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lassign [dict get $failed $name] type reason
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ switch $type {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ skipped {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append note " Skipped because its $reason\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ failed {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append note " Failed: $reason\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach change $changes {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lassign $change field old new
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append note " $field changed from '$old' to '$new'\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[llength $just_changed] > 0} {
</span> append note "The following ports were restored with changes:\n"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach changed_port [lsort -ascii -index 0 $diff(changed)] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach changed_port [lsort -ascii -index 0 $just_changed] {
</span> lassign $changed_port name _ _ _ requested_variants changes
if {$requested_variants ne ""} {
append note " - $name\n"
</pre><pre style='margin:0'>
</pre>