summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-19 01:45:46 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-19 01:45:46 +0000
commitef3ce36c2a0e4f385c65ca6223ba4c5c4e86e122 (patch)
treea2c4f3f4d6f5bd558c64aa4fcf768fecf755b939 /perl-install/pkgs.pm
parentffbb1c226e9a3a8932646947a2e191089a195fc0 (diff)
downloaddrakx-ef3ce36c2a0e4f385c65ca6223ba4c5c4e86e122.tar
drakx-ef3ce36c2a0e4f385c65ca6223ba4c5c4e86e122.tar.gz
drakx-ef3ce36c2a0e4f385c65ca6223ba4c5c4e86e122.tar.bz2
drakx-ef3ce36c2a0e4f385c65ca6223ba4c5c4e86e122.tar.xz
drakx-ef3ce36c2a0e4f385c65ca6223ba4c5c4e86e122.zip
no_comment
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm25
1 files changed, 7 insertions, 18 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 1bcec9167..4b00800a7 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -284,21 +284,10 @@ sub readCompssUsers {
#- $1 eq $lang || eval { lang::text2lang($1) eq $lang } && !$@;
#- }
-sub setSelectedFromCompssList($$$$$$) {
- my ($compssListLevels, $packages, $level, $install_class) = @_;
+sub setSelectedFromCompssList {
+ my ($compssListLevels, $packages, $min_level, $max_size, $install_class, $isUpgrade) = @_;
my ($ind);
- map_index { $ind = $::i if $_ eq $install_class } @$compssListLevels;
-
- foreach (allpackages($packages)) {
- &select($packages, $_) if $_->{values}[$ind] >= $level;
- }
-}
-
-sub setSelectedFromCompssList_($$$$$$) {
- my ($compssListLevels, $packages, $size, $install_class, $isUpgrade) = @_;
- my ($level, $ind) = 100;
-
my @packages = allpackages($packages);
my @places = do {
map_index { $ind = $::i if $_ eq $install_class } @$compssListLevels;
@@ -309,20 +298,20 @@ sub setSelectedFromCompssList_($$$$$$) {
};
foreach (@places) {
my $p = $packages[$_];
- $level = min($level, $p->{values}[$ind]);
- last if $level == 0;
+ last if $p->{values}[$ind] < $min_level;
&select($packages, $p) unless $isUpgrade;
my $nb = 0; foreach (@packages) {
$nb += $_->{size} if $_->{selected};
}
- if ($nb > $size) {
- unselect($packages, $p, $nb - $size) unless $isUpgrade;
+ if ($nb > $max_size) {
+ unselect($packages, $p, $nb - $max_size) unless $isUpgrade;
+ $min_level = $p->{values}[$ind];
last;
}
}
- $ind, $level;
+ $ind, $min_level;
}
sub init_db {