summaryrefslogtreecommitdiffstats
path: root/perl-install/install/pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-12-14 16:41:26 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-12-14 16:48:01 +0100
commit50edb3c63a62c3b842f483588bdde8deb8a4fc84 (patch)
tree77248e8a8a044b38019a3af31d2841681ff7a5ea /perl-install/install/pkgs.pm
parent1b0aaf551631c1f9c997100b61d674abf7aead75 (diff)
downloaddrakx-50edb3c63a62c3b842f483588bdde8deb8a4fc84.tar
drakx-50edb3c63a62c3b842f483588bdde8deb8a4fc84.tar.gz
drakx-50edb3c63a62c3b842f483588bdde8deb8a4fc84.tar.bz2
drakx-50edb3c63a62c3b842f483588bdde8deb8a4fc84.tar.xz
drakx-50edb3c63a62c3b842f483588bdde8deb8a4fc84.zip
(size2time) enforce returning a float (mga#19930)
with the previous fix, the progress bar will now properly update on i586 will be a float between 0 & 1
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r--perl-install/install/pkgs.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 6602acf90..b83655401 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -69,8 +69,12 @@ sub selectedSize {
$size;
}
+sub int64_to_float { sprintf("%.2f", $_[0])*1 }
+
sub size2time {
my ($x, $max) = @_;
+ $x = int64_to_float($x);
+ $max = int64_to_float($max);
my $A = 7e9;
my $limit = min($max * 3 / 4, 9e8);
if ($x < $limit) {