summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Viguera <javier.viguera@digi.com>2011-04-07 09:52:23 (GMT)
committerJavier Viguera <javier.viguera@digi.com>2011-04-07 09:52:23 (GMT)
commit0dccde0190ec691e9ee5f549fae3b75a4ede3fb8 (patch)
tree25e6cb27924765d6bc99c564b82dd0b9aaaf87c8
parent93426d8186f591368d5a906ba33071ad94308371 (diff)
functions: avoid CR when progress bar is not enabled
Using CT-NG with progress bar disabled, still prints CR ('\r') characters on the output. When you capture the output to a file as part of an automated build, it shows extra empty lines. For example: ------------------------------------------------------------ [INFO ] Performing some trivial sanity checks [INFO ] Build started 20110404.113619 [INFO ] Building environment variables [EXTRA] Preparing working directories [EXTRA] Installing user-supplied crosstool-NG configuration ------------------------------------------------------------ Signed-off-by: Javier Viguera <javier.viguera@digi.com> (transplanted from cbd07f3dd6e3689a6b971e999aa82d09fb94d515)
-rw-r--r--scripts/functions2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/functions b/scripts/functions
index ba92d11..321ad12 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -105,7 +105,7 @@ CT_DoLog() {
printf "[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}"
if [ ${cur_l} -le ${max_level} ]; then
# Only print to console (fd #6) if log level is high enough.
- printf "\r[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}" >&6
+ printf "${CT_LOG_PROGRESS_BAR:+\r}[%-5s]%*s%s%s\n" "${cur_L}" "${indent}" " " "${line}" >&6
fi
if [ "${CT_LOG_PROGRESS_BAR}" = "y" ]; then
printf "\r[%02d:%02d] %s " $((SECONDS/60)) $((SECONDS%60)) "${_prog_bar[$((_prog_bar_cpt/10))]}" >&6