summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-21 18:29:41 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-21 18:29:41 +0000
commit8fd1b94fd490f1f5e17c9e069f28f74155df82be (patch)
tree49292fda10f7a4bfc359982906b9ca778300b871
parenteb1eb2d3e28d5d9c4ea86e304c2eae4a7c0968b2 (diff)
downloadurpmi-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.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index ab428e17..f9b9a3e1 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -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;