diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2006-03-21 18:29:41 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2006-03-21 18:29:41 +0000 |
commit | 8fd1b94fd490f1f5e17c9e069f28f74155df82be (patch) | |
tree | 49292fda10f7a4bfc359982906b9ca778300b871 | |
parent | eb1eb2d3e28d5d9c4ea86e304c2eae4a7c0968b2 (diff) | |
download | urpmi-8fd1b94fd490f1f5e17c9e069f28f74155df82be.tar urpmi-8fd1b94fd490f1f5e17c9e069f28f74155df82be.tar.gz urpmi-8fd1b94fd490f1f5e17c9e069f28f74155df82be.tar.bz2 urpmi-8fd1b94fd490f1f5e17c9e069f28f74155df82be.tar.xz urpmi-8fd1b94fd490f1f5e17c9e069f28f74155df82be.zip |
Adjust progress bar length to terminal size
-rw-r--r-- | urpm.pm | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -2894,12 +2894,19 @@ sub extract_packages_to_install { \%inst; } +my $progress_size = 45; +eval { + require Term::ReadKey; + ($progress_size) = Term::ReadKey::GetTerminalSize(); + $progress_size -= 35; + $progress_size < 5 and $progress_size = 5; +}; + #- install logger (a la rpm) sub install_logger { my ($urpm, $type, $id, $subtype, $amount, $total) = @_; my $pkg = defined $id && $urpm->{depslist}[$id]; my $total_pkg = $urpm->{nb_install}; - my $progress_size = 45; if ($subtype eq 'start') { $urpm->{logger_progress} = 0; |