<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/f92ba30f9dc17a4606a6e26c103b60d876bfb065">https://github.com/macports/macports-base/commit/f92ba30f9dc17a4606a6e26c103b60d876bfb065</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit f92ba30f9dc17a4606a6e26c103b60d876bfb065
</span>Author: Clemens Lang <neverpanic@gmail.com>
AuthorDate: Wed Jul 24 17:20:14 2024 +0200
<span style='display:block; white-space:pre;color:#404040;'> port: Use stderr for progress bars
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This frees up stdout for legitimate uses, e.g., exporting a snapshot as
</span><span style='display:block; white-space:pre;color:#404040;'> JSON on stdout while displaying a progress bar on stderr.
</span>---
src/port/port.tcl | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 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 292613d44..c66e62ac6 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;'>@@ -4907,10 +4907,10 @@ namespace eval portclient::progress {
</span> intermission -
finish {
# erase to start of line
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ::term::ansi::send::esol
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ::term::ansi::send::esolch stderr
</span> # return cursor to start of line
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts -nonewline "\r"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- flush stdout
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts -nonewline stderr "\r"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flush stderr
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4962,10 +4962,10 @@ namespace eval portclient::progress {
</span> }
finish {
# erase to start of line
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ::term::ansi::send::esol
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ::term::ansi::send::esolch stderr
</span> # return cursor to start of line
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts -nonewline "\r"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- flush stdout
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts -nonewline stderr "\r"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flush stderr
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5065,8 +5065,8 @@ namespace eval portclient::progress {
</span> # Format the percentage using the space that has been reserved for it
set percentagesuffix [format " %[expr {$percentageWidth - 3}].1f %%" $percentage]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts -nonewline "\r${prefix}\[${progressbar}\]${percentagesuffix}${suffix}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- flush stdout
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts -nonewline stderr "\r${prefix}\[${progressbar}\]${percentagesuffix}${suffix}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flush stderr
</span> }
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5107,8 +5107,8 @@ namespace eval portclient::progress {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- puts -nonewline "\r${prefix}\[${progressbar}\]${suffix}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- flush stdout
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts -nonewline stderr "\r${prefix}\[${progressbar}\]${suffix}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ flush stderr
</span> }
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5550,7 +5550,7 @@ if {[catch {parse_options "global" ui_options global_options} result]} {
</span> exit 1
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-if {[isatty stdout]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {[isatty stderr]
</span> && $portclient::progress::hasTermAnsiSend eq "yes"
&& (![info exists ui_options(ports_quiet)] || $ui_options(ports_quiet) ne "yes")} {
set ui_options(progress_download) portclient::progress::download
</pre><pre style='margin:0'>
</pre>