<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch release-2.7
in repository macports-base.

</pre>
<p><a href="https://github.com/macports/macports-base/commit/aebad17505f4452e8b5acda75f33c3fd887e5c23">https://github.com/macports/macports-base/commit/aebad17505f4452e8b5acda75f33c3fd887e5c23</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/release-2.7 by this push:
<span style='display:block; white-space:pre;color:#404040;'>     new aebad175 Fix calculation of progress bar width when env(COLUMNS) is unavailable.
</span>aebad175 is described below

<span style='display:block; white-space:pre;color:#808000;'>commit aebad17505f4452e8b5acda75f33c3fd887e5c23
</span>Author: Landon Fuller <landonf@macports.org>
AuthorDate: Tue Apr 27 11:55:28 2021 -0600

<span style='display:block; white-space:pre;color:#404040;'>    Fix calculation of progress bar width when env(COLUMNS) is unavailable.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    (cherry picked from commit ad031bd7cd9a49cc92b261acf94a3459cf867b7e)
</span>---
 src/port/port.tcl | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 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 9100c803..d933f131 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;'>@@ -5063,6 +5063,21 @@ namespace eval portclient::progress {
</span>         }
     }
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    proc barWidth {reservedCols} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        global env
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        variable maxWidth
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {![info exists env(COLUMNS)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            return $maxWidth
</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 {$reservedCols > $env(COLUMNS)} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            return [expr {min($maxWidth, $env(COLUMNS)}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            return [expr {min($maxWidth, $env(COLUMNS) - $reservedCols)}]
</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>     ##
     # Progress callback for generic operations executed by macports 1.0.
     #
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5093,9 +5108,9 @@ namespace eval portclient::progress {
</span>                         set barPrefix "      "
                         set barPrefixLen [string length $barPrefix]
                         if {$total != 0} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                            progressbar $now $total [expr {min($maxWidth, $env(COLUMNS) - $barPrefixLen)}] $barPrefix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            progressbar $now $total [barWidth $barPrefixLen] $barPrefix
</span>                         } else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                            unprogressbar [expr {min($maxWidth, $env(COLUMNS) - $barPrefixLen)}] $barPrefix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            unprogressbar [barWidth $barPrefixLen] $barPrefix
</span>                         }
                     }
                 }
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5147,15 +5162,15 @@ namespace eval portclient::progress {
</span>                         if {$total != 0} {
                             set barSuffix [format "        speed: %-13s" "[bytesize $speed {} "%.1f"]/s"]
                             set barSuffixLen [string length $barSuffix]
<span style='display:block; white-space:pre;background:#e0ffe0;'>+                            set barWidth [barWidth [expr {$barPrefixLen + $barSuffixLen}]]
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                            set barLen [expr {min($maxWidth, $env(COLUMNS) - $barPrefixLen - $barSuffixLen)}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                            progressbar $now $total $barLen $barPrefix $barSuffix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            progressbar $now $total $barWidth $barPrefix $barSuffix
</span>                         } else {
                             set barSuffix [format " %-10s     speed: %-13s" [bytesize $now {} "%6.1f"] "[bytesize $speed {} "%.1f"]/s"]
                             set barSuffixLen [string length $barSuffix]
<span style='display:block; white-space:pre;background:#e0ffe0;'>+                            set barWidth [barWidth [expr {$barPrefixLen + $barSuffixLen}]]
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                            set barLen [expr {min($maxWidth, $env(COLUMNS) - $barPrefixLen - $barSuffixLen)}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                            unprogressbar $barLen $barPrefix $barSuffix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                            unprogressbar $barWidth $barPrefix $barSuffix
</span>                         }
                     }
                 }
</pre><pre style='margin:0'>

</pre>