Blame 0026-url-lib-don-t-use-progress-bar-if-TERM-dumb-RHBZ-814.patch

Harald Hoyer 2f4f1d
From dc1504121b1119f9d797aa276f040f3dfe9d56a3 Mon Sep 17 00:00:00 2001
Harald Hoyer 2f4f1d
From: Will Woods <wwoods@redhat.com>
Harald Hoyer 2f4f1d
Date: Fri, 20 Apr 2012 16:20:25 -0400
Harald Hoyer 2f4f1d
Subject: [PATCH] url-lib: don't use --progress-bar if TERM=dumb (RHBZ#814713)
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
Basically, s390 is the only place I've ever seen TERM=dumb, and it's too
Harald Hoyer 2f4f1d
dumb to handle '\r', so --progress-bar produces waaaaay too much output.
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
The normal progress meter only prints something once per second, so
Harald Hoyer 2f4f1d
that's reasonable on terminals where '\r' doesn't work.
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
See also: https://bugzilla.redhat.com/show_bug.cgi?id=814713
Harald Hoyer 2f4f1d
---
Harald Hoyer 2f4f1d
 modules.d/45url-lib/url-lib.sh |    7 ++++++-
Harald Hoyer 2f4f1d
 1 file changed, 6 insertions(+), 1 deletion(-)
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
diff --git a/modules.d/45url-lib/url-lib.sh b/modules.d/45url-lib/url-lib.sh
Harald Hoyer 2f4f1d
index 7930146..5721294 100755
Harald Hoyer 2f4f1d
--- a/modules.d/45url-lib/url-lib.sh
Harald Hoyer 2f4f1d
+++ b/modules.d/45url-lib/url-lib.sh
Harald Hoyer 2f4f1d
@@ -54,7 +54,12 @@ add_url_handler() {
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 export CURL_HOME="/run/initramfs/url-lib"
Harald Hoyer 2f4f1d
 mkdir -p $CURL_HOME
Harald Hoyer 2f4f1d
-curl_args="--location --retry 3 --fail --show-error --progress-bar"
Harald Hoyer 2f4f1d
+curl_args="--location --retry 3 --fail --show-error"
Harald Hoyer 2f4f1d
+
Harald Hoyer 2f4f1d
+# technically "dumb" can handle the progress bar, but the only thing I've ever
Harald Hoyer 2f4f1d
+# seen using TERM=dumb is s390 CMS, and it's too dumb for --progress-bar
Harald Hoyer 2f4f1d
+[ "$TERM" != "dumb" ] && curl_args="$curl_args --progress-bar"
Harald Hoyer 2f4f1d
+
Harald Hoyer 2f4f1d
 curl_fetch_url() {
Harald Hoyer 2f4f1d
     local url="$1" outloc="$2"
Harald Hoyer 2f4f1d
     echo "$url" > /proc/self/fd/0