summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-09-03 09:43:21 -0400
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-09-03 09:44:29 -0400
commit3c7fca264ec9f85667c9bcaa19e5d9075b8664b8 (patch)
treec1e6ca150caa6eec62a1a97653502b3575d8c6e1 /urpm/download.pm
parent82678294c9064f6093610a7ea062d202ba621fdf (diff)
downloadurpmi-3c7fca264ec9f85667c9bcaa19e5d9075b8664b8.tar
urpmi-3c7fca264ec9f85667c9bcaa19e5d9075b8664b8.tar.gz
urpmi-3c7fca264ec9f85667c9bcaa19e5d9075b8664b8.tar.bz2
urpmi-3c7fca264ec9f85667c9bcaa19e5d9075b8664b8.tar.xz
urpmi-3c7fca264ec9f85667c9bcaa19e5d9075b8664b8.zip
fix Term::ReadKey warnings when redirected
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index c6800f73..c21caeca 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -815,11 +815,13 @@ END {
#- get the width of the terminal
my $wchar = 79;
-eval {
+if (-t STDOUT) {
+ eval {
require Term::ReadKey;
($wchar) = Term::ReadKey::GetTerminalSize();
--$wchar;
-};
+ };
+}
sub progress_text {
my ($mode, $percent, $total, $eta, $speed) = @_;