summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/ChangeLog11
-rw-r--r--perl-install/common.pm4
-rw-r--r--perl-install/install_steps.pm3
-rw-r--r--perl-install/install_steps_interactive.pm15
4 files changed, 22 insertions, 11 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog
index 339cae985..0e00acb0b 100644
--- a/perl-install/ChangeLog
+++ b/perl-install/ChangeLog
@@ -1,3 +1,14 @@
+2000-10-09 Pixel <pixel@mandrakesoft.com>
+
+ * install_steps.pm (selectKeyboard): don't assume $o->{langs} is set
+ (selectLanguage): don't set $o->{langs} (so that you can go back
+ and it works)
+
+ * common.pm (round_up, round_down): ensure number is an integer
+
+ * install_steps_interactive.pm (chooseGroups): take into account
+ the min_level to compute the size
+
2000-10-08 Pixel <pixel@mandrakesoft.com>
* install_steps_interactive.pm (choosePackages): move the
diff --git a/perl-install/common.pm b/perl-install/common.pm
index baa46e46a..6b56550ac 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -96,8 +96,8 @@ sub symlinkf { unlink $_[1]; symlink $_[0], $_[1] }
sub chop_ { map { my $l = $_; chomp $l; $l } @_ }
sub divide { my $d = int $_[0] / $_[1]; wantarray ? ($d, $_[0] % $_[1]) : $d }
sub round { int ($_[0] + 0.5) }
-sub round_up { my ($i, $r) = @_; $i += $r - ($i + $r - 1) % $r - 1; }
-sub round_down { my ($i, $r) = @_; $i -= $i % $r; }
+sub round_up { my ($i, $r) = @_; $i = int $i; $i += $r - ($i + $r - 1) % $r - 1; }
+sub round_down { my ($i, $r) = @_; $i = int $i; $i -= $i % $r; }
sub is_empty_array_ref { my $a = shift; !defined $a || @$a == 0 }
sub is_empty_hash_ref { my $a = shift; !defined $a || keys(%$a) == 0 }
sub difference2 { my %l; @l{@{$_[1]}} = (); grep { !exists $l{$_} } @{$_[0]} }
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index 5934476c4..f0d82694d 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -87,7 +87,6 @@ sub set_help { 1 }
sub selectLanguage {
my ($o) = @_;
lang::set($o->{lang});
- $o->{langs} ||= [ $o->{lang} ];
if ($o->{keyboard_unsafe} || !$o->{keyboard}) {
$o->{keyboard_unsafe} = 1;
@@ -99,7 +98,7 @@ sub selectLanguage {
sub selectKeyboard {
my ($o) = @_;
keyboard::setup($o->{keyboard});
- lang::set_langs($o->{langs});
+ lang::set_langs($o->{langs} || [ $o->{lang} ]);
}
#------------------------------------------------------------------------------
sub selectPath {}
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index a0a70e4a0..a3d24602e 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -435,11 +435,11 @@ sub choosePackages {
my $min_mark = $::beginner ? 25 : $::expert ? 0 : 1;
my $b = pkgs::saveSelected($packages);
- my (undef, $level) = pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $min_mark, 0, $o->{installClass});
+ my ($ind, $level) = pkgs::setSelectedFromCompssList($o->{compssListLevels}, $packages, $min_mark, 0, $o->{installClass});
my $max_size = pkgs::selectedSize($packages) + 1; #- avoid division by zero.
pkgs::restoreSelected($b);
- $o->chooseGroups($packages, $compssUsers, \$individual, $max_size) unless $::beginner || $::corporate;
+ $o->chooseGroups($packages, $compssUsers, $min_mark, $ind, \$individual, $max_size) unless $::beginner || $::corporate;
my $size2install = min($availableC, do {
my $max = round_up(min($max_size, $availableC) / sqr(1024), 100);
@@ -465,7 +465,7 @@ sub choosePackages {
}
});
if (!$size2install) { #- special case for desktop
- $o->chooseGroups($packages, $compssUsers) or goto &choosePackages;
+ $o->chooseGroups($packages, $compssUsers, $min_mark, $ind) or goto &choosePackages;
$size2install = $availableC;
}
($o->{packages_}{ind}) =
@@ -481,13 +481,13 @@ sub chooseSizeToInstall {
sub choosePackagesTree {}
sub chooseGroups {
- my ($o, $packages, $compssUsers, $individual, $max_size) = @_;
+ my ($o, $packages, $compssUsers, $min_level, $ind, $individual, $max_size) = @_;
my %size;
my $base = pkgs::selectedSize($packages);
foreach (@{$o->{compssUsersSorted}}) {
my $b = pkgs::saveSelected($packages);
- pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}};
+ $_->{values}[$ind] < $min_level or pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}};
$size{$_} = pkgs::selectedSize($packages) - $base;
pkgs::restoreSelected($b);
}
@@ -498,11 +498,12 @@ sub chooseGroups {
my $b = pkgs::saveSelected($packages);
foreach (@{$o->{compssUsersSorted}}) {
- pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}};
+ $_->{values}[$ind] < $min_level or pkgs::selectPackage($packages, $_) foreach @{$compssUsers->{$_}};
}
$size{Miscellaneous} = $max_size - pkgs::selectedSize($packages);
pkgs::restoreSelected($b);
}
+ @groups = grep { $size{$_} = round_down($size{$_} / sqr(1024), 10) } @groups; #- don't display the empty or small one (eg: because all packages are below $min_level)
my $all;
$o->ask_many_from_list('', _("Package Group Selection"),
{ list => \@groups,
@@ -514,7 +515,7 @@ sub chooseGroups {
-e "$f.xpm" or $f = '/usr/share/icons/default_section';
"$f.xpm";
},
- label => sub { translate($_) . ($size{$_} ? sprintf " (%d%s)", round_down($size{$_} / sqr(1024), 10), _("MB") : '') },
+ label => sub { translate($_) . ($size{$_} ? sprintf " (%d%s)", $size{$_}, _("MB") : '') },
},
$o->{meta_class} eq 'desktop' ? { list => [ _("All") ], ref => sub { \$all }, shadow => 0 } : (),
$individual ? { list => [ _("Individual package selection") ], ref => sub { $individual } } : (),