From 4920fbf71ee20c8cfd44fa6a73c06f2159932cff Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 7 Sep 2017 20:24:35 +0200 Subject: adapt to URPM-5.14 (using perl native ints) See mga#21441 --- perl-install/install/NEWS | 1 + perl-install/install/pkgs.pm | 11 +++-------- perl-install/install/share/list.xml | 1 - perl-install/install/steps_gtk.pm | 3 +-- perl-install/install/steps_interactive.pm | 3 +-- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 7ce0eb1b4..6f0867b45 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,4 +1,5 @@ - include part of udev's hwdb (mga#20327) +- adapt to URPM-5.14 (using perl native ints) Version 17.88 - 7 July 2017 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++; diff --git a/perl-install/install/share/list.xml b/perl-install/install/share/list.xml index 5748262b1..6a1935517 100644 --- a/perl-install/install/share/list.xml +++ b/perl-install/install/share/list.xml @@ -639,7 +639,6 @@ perl-Pango perl-Clone - perl-Math-Int64 perl-URPM diff --git a/perl-install/install/steps_gtk.pm b/perl-install/install/steps_gtk.pm index 01f341c1f..213d1a96e 100644 --- a/perl-install/install/steps_gtk.pm +++ b/perl-install/install/steps_gtk.pm @@ -4,7 +4,6 @@ use diagnostics; use strict; use feature 'state'; use vars qw(@ISA); -use Math::Int64 ':native_if_available', 'int64'; @ISA = qw(install::steps_interactive interactive::gtk); @@ -628,7 +627,7 @@ sub installPackages { if ($type eq 'user' && $subtype eq 'install') { #- $amount and $total are used to return number of package and total size. $nb = $amount; - $total_size = $total; $current_total_size = int64(0); + $total_size = $total; $current_total_size = 0; $o->{install_start_time} = 0; mygtk3::gtkadd($pkg_log_widget, text => P("%d package", "%d packages", $nb, $nb)); $w->flush; diff --git a/perl-install/install/steps_interactive.pm b/perl-install/install/steps_interactive.pm index 8cddb5bcf..bc9fae579 100644 --- a/perl-install/install/steps_interactive.pm +++ b/perl-install/install/steps_interactive.pm @@ -3,7 +3,6 @@ package install::steps_interactive; use strict; use feature 'state'; -use Math::Int64 ':native_if_available', 'int64'; our @ISA = qw(install::steps); @@ -642,7 +641,7 @@ sub beforeInstallPackages { #------------------------------------------------------------------------------ sub installPackages { my ($o) = @_; - my ($current, $total) = (int64(0), 0); + my ($current, $total) = (0, 0); my ($_w, $wait_message) = $o->wait_message_with_progress_bar(N("Installing")); $wait_message->(N("Preparing installation"), 0, 100); #- beware, interactive::curses::wait_message_with_progress_bar need to create the Dialog::Progress here because in installCallback we are chrooted -- cgit v1.2.1