diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | urpm/download.pm | 6 | ||||
-rw-r--r-- | urpm/install.pm | 6 |
3 files changed, 9 insertions, 4 deletions
@@ -2,6 +2,7 @@ o fix using a proxy without an auth user (mga#11265) - library: o fix unmarking packages as potential orphans when downgrading (mga#16149) + o fix Term::ReadKey warnings when output is redirected - testsuite: o misc enhancements & cleanups o fix tests for ignored faillure for %pre{,un}, %pretrans 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) = @_; diff --git a/urpm/install.pm b/urpm/install.pm index 08e43236..d4b83706 100644 --- a/urpm/install.pm +++ b/urpm/install.pm @@ -21,12 +21,14 @@ urpm::install - Package installation transaction routines for urpmi # size of the installation progress bar my $progress_size = 45; -eval { +if (-t STDOUT) { + eval { require Term::ReadKey; ($progress_size) = Term::ReadKey::GetTerminalSize(); $progress_size -= 35; $progress_size < 5 and $progress_size = 5; -}; + }; +} sub _hash_intersect_list { |