summaryrefslogtreecommitdiffstats
path: root/perl-install/install/pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2017-09-07 20:24:35 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2017-09-07 21:08:09 +0200
commit4920fbf71ee20c8cfd44fa6a73c06f2159932cff (patch)
treee6a7c812e24701d4eb70567269d1b1bcff9f3427 /perl-install/install/pkgs.pm
parent102339802fe667e53d517f522d24bb9e4c652019 (diff)
downloaddrakx-4920fbf71ee20c8cfd44fa6a73c06f2159932cff.tar
drakx-4920fbf71ee20c8cfd44fa6a73c06f2159932cff.tar.gz
drakx-4920fbf71ee20c8cfd44fa6a73c06f2159932cff.tar.bz2
drakx-4920fbf71ee20c8cfd44fa6a73c06f2159932cff.tar.xz
drakx-4920fbf71ee20c8cfd44fa6a73c06f2159932cff.zip
adapt to URPM-5.14 (using perl native ints)
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r--perl-install/install/pkgs.pm11
1 files changed, 3 insertions, 8 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index b83655401..3317f0fbe 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -2,7 +2,6 @@ package install::pkgs;
use strict;
use feature 'state';
-use Math::Int64 ':native_if_available', 'int64';
BEGIN {
# needed before "use URPM"
@@ -47,7 +46,7 @@ sub invCorrectSize { ($_[0] * $D - $C) / $B }
sub selectedSize {
my ($packages) = @_;
- my $size = int64(0);
+ my $size = 0;
my %skip;
#- take care of packages selected...
foreach (@{$packages->{depslist}}) {
@@ -69,12 +68,8 @@ 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) {
@@ -732,7 +727,7 @@ sub selectPackagesAlreadyInstalled {
my %sizes;
$packages->{rpmdb}->traverse(sub {
my ($p) = @_;
- $sizes{$p->name} ||= int64(0);
+ $sizes{$p->name} ||= 0;
$sizes{$p->name} += $p->size;
});
$packages->{sizes} = \%sizes;
@@ -790,7 +785,7 @@ sub install {
#- first stage to extract some important information
#- about the selected packages.
- my ($total, $nb) = (int64(0), 0);
+ my ($total, $nb) = (0, 0);
foreach my $pkg (@$toInstall) {
$packages{$pkg->id} = $pkg;
$nb++;