aboutsummaryrefslogtreecommitdiffstats
path: root/grpmi/grpmi.pl
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2002-08-02 13:33:17 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2002-08-02 13:33:17 +0000
commit2b3847be2f95af0a5dfb0874e362e3274e02736c (patch)
treeb37636d621dddafcf62b906f9378335f2d10aac7 /grpmi/grpmi.pl
parent8b96f8d0ca7cef761e48a54ba331ffc91bf8b094 (diff)
downloadrpmdrake-2b3847be2f95af0a5dfb0874e362e3274e02736c.tar
rpmdrake-2b3847be2f95af0a5dfb0874e362e3274e02736c.tar.gz
rpmdrake-2b3847be2f95af0a5dfb0874e362e3274e02736c.tar.bz2
rpmdrake-2b3847be2f95af0a5dfb0874e362e3274e02736c.tar.xz
rpmdrake-2b3847be2f95af0a5dfb0874e362e3274e02736c.zip
fix grpmi exiting on illegal division by zero when curl reports a
download of zero size
Diffstat (limited to 'grpmi/grpmi.pl')
-rwxr-xr-xgrpmi/grpmi.pl3
1 files changed, 2 insertions, 1 deletions
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) {