summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-08-04 00:29:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-08-04 00:29:32 +0000
commita3d551a6468bd1799197187d185689e3ac9cb4db (patch)
tree4e07ef60416129b6bd1b514536346c33c922791b /perl-install/pkgs.pm
parent299573a7ecaf76b17411611dabd08c822f9b6f53 (diff)
downloaddrakx-a3d551a6468bd1799197187d185689e3ac9cb4db.tar
drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.gz
drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.bz2
drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.tar.xz
drakx-a3d551a6468bd1799197187d185689e3ac9cb4db.zip
no_comment
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index af23fe99d..dc3813baf 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -36,6 +36,7 @@ use c;
);
#- HACK: rating += 50 for some packages (like kapm, cf install_any::setPackages)
#- HACK: rating += 10 if the group is selected and it is not a kde package (aka name !~ /^k/)
+#- HACK: rating += 1 if the group is selected and it is a kde package (aka name !~ /^k/)
@skip_list = qw(
@@ -706,10 +707,12 @@ sub setSelectedFromCompssList {
selectPackage($packages, $p, 0, \%newSelection);
#- this enable an incremental total size.
+ my $old_nb = $nb;
foreach (grep { $newSelection{$_} } keys %newSelection) {
$nb += packageSize($packages->[0]{$_});
}
if ($max_size && $nb > $max_size) {
+ $nb = $old_nb;
$min_level = $p->{values}[$ind];
last;
}
@@ -721,6 +724,19 @@ sub setSelectedFromCompssList {
$ind, $min_level;
}
+#- usefull to know the size it would take for a given min_level/max_size
+#- just saves the selected packages, call setSelectedFromCompssList and restores the selected packages
+sub fakeSetSelectedFromCompssList {
+ my ($compssListLevels, $packages, $min_level, $max_size, $install_class) = @_;
+ my @l = values %{$packages->[0]};
+ my @flags = map { pkgs::packageFlagSelected($_) } @l;
+ my (undef, $level) = setSelectedFromCompssList($compssListLevels, $packages, $min_level, $max_size, $install_class);
+ my $size = pkgs::selectedSize($packages);
+ mapn { pkgs::packageSetFlagSelected(@_) } \@l, \@flags;
+ $size, $level;
+}
+
+
sub init_db {
my ($prefix, $isUpgrade) = @_;