summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-09-26 17:32:48 +0000
committerFrancois Pons <fpons@mandriva.com>2000-09-26 17:32:48 +0000
commit9dbbb14f150c2b41bab19bea23468352219ce793 (patch)
tree24884e3c893be28779d722473d3242dc0844db40
parentb8b170d87f522920b26b5117b32da974f4b7079e (diff)
downloaddrakx-9dbbb14f150c2b41bab19bea23468352219ce793.tar
drakx-9dbbb14f150c2b41bab19bea23468352219ce793.tar.gz
drakx-9dbbb14f150c2b41bab19bea23468352219ce793.tar.bz2
drakx-9dbbb14f150c2b41bab19bea23468352219ce793.tar.xz
drakx-9dbbb14f150c2b41bab19bea23468352219ce793.zip
*** empty log message ***
-rw-r--r--perl-install/ChangeLog5
-rw-r--r--perl-install/pkgs.pm9
2 files changed, 12 insertions, 2 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index 2812b6721..db5988a0e 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,3 +1,8 @@
+2000-09-26 François Pons <fpons@mandrakesoft.com>
+
+ * pkgs.pm: fixed correction size code to make (really) a true
+ bijection between corrected and rpm size.
+
2000-09-26 DrakX <install@linux-mandrake.com>
* snapshot uploaded
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 5f81d914d..036141472 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -199,8 +199,13 @@ my $A = -121568/100000000000; # -1.21568e-05; #- because perl does like that on
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 { $_[0] < $D ? ($A * $_[0] + $B) * $_[0] + $C : $_[0] } #- size correction in MB.
-sub invCorrectSize { $_[0] < $D ? (sqrt(sqr($B) + 4 * $A * ($_[0] - $C)) - $B) / 2 / $A : $_[0]; } #- size correction in MB.
+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];
+}
sub selectedSize {
my ($packages) = @_;