summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-14 15:31:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-14 15:31:39 +0000
commitea9c3745c624d7385fb84ee18fc896b3721bff37 (patch)
treee6959a2c8eff81c952cdf188fc3f252e0153e8bf /perl-install/pkgs.pm
parentc8248f75d0b8ee731e40a09416febdbeafb9e48f (diff)
downloaddrakx-ea9c3745c624d7385fb84ee18fc896b3721bff37.tar
drakx-ea9c3745c624d7385fb84ee18fc896b3721bff37.tar.gz
drakx-ea9c3745c624d7385fb84ee18fc896b3721bff37.tar.bz2
drakx-ea9c3745c624d7385fb84ee18fc896b3721bff37.tar.xz
drakx-ea9c3745c624d7385fb84ee18fc896b3721bff37.zip
update correctSize and invCorrectSize (now linear)
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm23
1 files changed, 4 insertions, 19 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index d844e7ec6..8258ce9a1 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -151,25 +151,10 @@ sub extractHeaders($$$) {
}
#- size and correction size functions for packages.
-#- invCorrectSize corrects size in the range 0 to 3Gb approximately, so
-#- it should not be used outside these levels.
-#- but since it is an inverted parabolic curve starting above 0, we can
-#- get a solution where X=Y at approximately 9.3Gb. we use this point as
-#- a limit to change the approximation to use a linear one.
-#- for information above this point, we have the corrected size below the
-#- original size wich is absurd, this point is named D below.
-my $A = -121568/100000000000; # -1.21568e-05; #- because perl does like that on some language (TO BE FIXED QUICKLY)
-my $B = 121561/100000; # 1.21561
-my $C = -239889/10000; # -23.9889 #- doesn't take hdlist's into account as getAvailableSpace will do it.
-my $D = (-sqrt(sqr($B - 1) - 4 * $A * $C) - ($B - 1)) / 2 / $A; #- $A is negative so a positive solution is with - sqrt ...
-sub correctSize {
- my $csz = ($A * $_[0] + $B) * $_[0] + $C;
- $csz > $_[0] ? $csz : $_[0]; #- size correction (in MB) should be above input argument (as $A is negative).
-}
-sub invCorrectSize {
- my $sz = $_[0] < $D ? (sqrt(sqr($B) + 4 * $A * ($_[0] - $C)) - $B) / 2 / $A : $_[0];
- $sz < $_[0] ? $sz : $_[0];
-}
+my $B = 1.20873;
+my $C = 4.98663; #- doesn't take hdlist's into account as getAvailableSpace will do it.
+sub correctSize { $B * $_[0] + $C }
+sub invCorrectSize { ($_[0] - $C) / $B }
sub selectedSize {
my ($packages) = @_;