diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-01-03 17:30:17 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-01-03 17:30:17 +0000 |
commit | 9680a74c3cb9605cc8b5235fc7e82af5f48117e6 (patch) | |
tree | 3fdd619690c8a7dae5a209867e18b90bb9156d1a /perl-install/pkgs.pm | |
parent | 530019effd566e71f900dde5cff3ee53c408b8a1 (diff) | |
download | drakx-9680a74c3cb9605cc8b5235fc7e82af5f48117e6.tar drakx-9680a74c3cb9605cc8b5235fc7e82af5f48117e6.tar.gz drakx-9680a74c3cb9605cc8b5235fc7e82af5f48117e6.tar.bz2 drakx-9680a74c3cb9605cc8b5235fc7e82af5f48117e6.tar.xz drakx-9680a74c3cb9605cc8b5235fc7e82af5f48117e6.zip |
no_comment
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 83bc78676..8e3ecf63f 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -48,6 +48,12 @@ my $B = 16258; sub correctSize { ($A - $_[0]) * $_[0] / $B } #- size correction in MB. sub invCorrectSize { $A / 2 - sqrt(max(0, sqr($A) - 4 * $B * $_[0])) / 2 } +sub selectedSize { + my ($packages) = @_; + int (sum map { $_->{size} } grep { $_->{selected} } values %$packages) / sqr(1024); +} +sub correctedSelectedSize { correctSize(selectedSize($_[0])) } + sub Package { my ($packages, $name) = @_; $packages->{$name} or log::l("unknown package `$name'") && undef; |