<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/2cc59df311acd55160270bd4acaee71a701c13f9">https://github.com/macports/macports-base/commit/2cc59df311acd55160270bd4acaee71a701c13f9</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 2cc59df311acd55160270bd4acaee71a701c13f9
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sun Jul 7 17:55:58 2024 +1000
<span style='display:block; white-space:pre;color:#404040;'> action_selfupdate: don't re-execute if --no-sync
</span>---
src/port/port.tcl | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 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 bbdf5a668..793646cbf 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;'>@@ -2452,25 +2452,27 @@ proc action_selfupdate { action portlist opts } {
</span> return -999
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # When re-executing, strip the -f flag to prevent an endless loop
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set new_argv {}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- foreach arg $::argv {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[string match -nocase {-[a-z]*} $arg]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # map the -f flag to nothing
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set arg [string map {f ""} $arg]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$arg eq "-"} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # if -f was specified alone, just remove the flag completely
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {![dict exists $options ports_selfupdate_no-sync] || ![dict get $options ports_selfupdate_no-sync]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # When re-executing, strip the -f flag to prevent an endless loop
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set new_argv {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach arg $::argv {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string match -nocase {-[a-z]*} $arg]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # map the -f flag to nothing
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set arg [string map {f ""} $arg]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$arg eq "-"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # if -f was specified alone, just remove the flag completely
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend new_argv $arg
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend new_argv $arg
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # If this returns at all, it failed. Just catch any error to avoid
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # printing a backtrace at the top level.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- catch {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- execl $::argv0 $new_argv
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # If this returns at all, it failed. Just catch any error to avoid
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # printing a backtrace at the top level.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ catch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ execl $::argv0 $new_argv
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_error "Failed to re-execute selfupdate, please run 'sudo port selfupdate' manually."
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "Failed to re-execute selfupdate, please run 'sudo port selfupdate' manually."
</span> return -999
}
</pre><pre style='margin:0'>
</pre>