summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/install_steps_gtk.pm6
-rw-r--r--perl-install/pkgs.pm6
2 files changed, 6 insertions, 6 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index c48a5b982..4af5df6da 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -453,14 +453,10 @@ sub choosePackagesTree {
};
my $update_size = sub {
- my $size = 0;
- foreach (values %{$packages->[0]}) {
- $size += pkgs::packageSize($_) - ($_->{installedCumulSize} || 0) if pkgs::packageFlagSelected($_); #- on upgrade, installed packages will be removed.
- }
+ my $size = pkgs::selectedSize();
$w_size->set(_("Total size: %d / %d MB",
pkgs::correctSize($size / sqr(1024)),
install_any::getAvailableSpace($o) / sqr(1024)));
-
};
my $toggle = sub {
if (ref $curr) {
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index f591e9bbb..9c745a1f2 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -177,7 +177,11 @@ sub invCorrectSize { min($_[0], (sqrt(sqr($B) + 4 * $A * ($_[0] - $C)) - $B) / 2
sub selectedSize {
my ($packages) = @_;
- int (sum map { packageSize($_) - ($_->{installedCumulSize} || 0) } grep { packageFlagSelected($_) } values %{$packages->[0]});
+ my $size = 0;
+ foreach (values %{$packages->[0]}) {
+ packageFlagSelected($_) && !packageFlagInstalled($_) and $size += packageSize($_) - ($_->{installedCumulSize} || 0);
+ }
+ $size;
}
sub correctedSelectedSize { correctSize(selectedSize($_[0]) / sqr(1024)) }