<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/99d49c9a0be5edadfc108de3cd95163d41f3e4ef">https://github.com/macports/macports-base/commit/99d49c9a0be5edadfc108de3cd95163d41f3e4ef</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 99d49c9a0be5edadfc108de3cd95163d41f3e4ef
</span>Author: Clemens Lang <neverpanic@gmail.com>
AuthorDate: Wed Jul 24 17:21:41 2024 +0200
<span style='display:block; white-space:pre;color:#404040;'> snapshot: Handle errors with unknown snapshot IDs
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> (cherry picked from commit 6b8b5ca3b756f0a6bae8d62ef5f12623238b5f17)
</span>---
src/macports1.0/snapshot.tcl | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/snapshot.tcl b/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 50f943522..f9a1a06fe 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/snapshot.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -42,8 +42,8 @@ namespace eval snapshot {
</span> ui_msg " port snapshot --delete <snapshot-id>"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- proc main {opts} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Function to create a snapshot of the current state of ports.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ proc main {opts} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Function to create a snapshot of the current state of ports.
</span> #
# Args:
# opts - The options passed in.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -110,7 +110,10 @@ namespace eval snapshot {
</span> return 0
}
"diff" {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set snapshot [registry::snapshot get_by_id [dict get $opts ports_snapshot_diff]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {set snapshot [registry::snapshot get_by_id [dict get $opts ports_snapshot_diff]]} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "Failed to obtain snapshot with ID [dict get $opts ports_snapshot_diff]: $result"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> array set diff [diff $snapshot]
set show_all [dict exists $opts ports_snapshot_all]
set note ""
</pre><pre style='margin:0'>
</pre>