From 2b3847be2f95af0a5dfb0874e362e3274e02736c Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Fri, 2 Aug 2002 13:33:17 +0000 Subject: fix grpmi exiting on illegal division by zero when curl reports a download of zero size --- grpmi/grpmi.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grpmi') diff --git a/grpmi/grpmi.pl b/grpmi/grpmi.pl index 3774aeec..43e88fb8 100755 --- a/grpmi/grpmi.pl +++ b/grpmi/grpmi.pl @@ -84,7 +84,8 @@ my $cache_location = '/var/cache/urpmi/rpms'; for (my $i=0; $i<@ARGV; $i++) { if ($ARGV[$i] =~ m,^http://|^https://|^ftp://,) { $label->set(_("Downloading package `%s'...", basename($ARGV[$i]))); select(undef, undef, undef, 0.1); $mainw->flush; #- hackish :-( - my $res = curl_download::download($ARGV[$i], $cache_location, $proxy, sub { $progressbar->update($_[1]/$_[0]); $mainw->flush }); + my $res = curl_download::download($ARGV[$i], $cache_location, $proxy, + sub { $_[0] and $progressbar->update($_[1]/$_[0]); $mainw->flush }); my $url = $ARGV[$i]; $ARGV[$i] = "$cache_location/" . basename($ARGV[$i]); if ($res) { -- cgit v1.2.1