From fa1568c5689de4a6a788c44e8a592f334a9c8db0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 11 Jun 2007 16:25:48 +0000 Subject: wait for total to be given before displaying progress (#31302) --- urpm/download.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'urpm') diff --git a/urpm/download.pm b/urpm/download.pm index 26bcaa34..18888b44 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -262,7 +262,8 @@ sub sync_wget { $total = ''; } elsif (defined $total && $total eq '' && $buf =~ /^[^:]*:\s+(\d\S*)/) { $total = $1; - } elsif (my ($percent, $speed, $eta) = $buf =~ /^\s*(\d+)%.*\s+(\S+)\s+ETA\s+(\S+)\s*[\r\n]$/ms) { + } elsif (defined $total && $buf =~ /^\s*(\d+)%.*\s+(\S+)\s+ETA\s+(\S+)\s*[\r\n]$/ms) { + my ($percent, $speed, $eta) = ($1, $2, $3); if (propagate_sync_callback($options, 'progress', $file, $percent, $total, $eta, $speed) eq 'canceled') { kill 15, $wget_pid; close $wget; -- cgit v1.2.1