diff options
author | Pascal Terjan <pterjan@mandriva.org> | 2010-04-01 15:05:53 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mandriva.org> | 2010-04-01 15:05:53 +0000 |
commit | 291710dad7c0827a022f7dc8f7a0bcf3fd6f30c7 (patch) | |
tree | 87353b74d4ecbe21ef579f7a2a07617f31a0750a /perl-install/install/pkgs.pm | |
parent | 448f2049fd1599df0c03e81514f30d176428f889 (diff) | |
download | drakx-291710dad7c0827a022f7dc8f7a0bcf3fd6f30c7.tar drakx-291710dad7c0827a022f7dc8f7a0bcf3fd6f30c7.tar.gz drakx-291710dad7c0827a022f7dc8f7a0bcf3fd6f30c7.tar.bz2 drakx-291710dad7c0827a022f7dc8f7a0bcf3fd6f30c7.tar.xz drakx-291710dad7c0827a022f7dc8f7a0bcf3fd6f30c7.zip |
compute dependencies on full list of packages from a rpmsrate level instead
of doing it individually. this way choices are made knowing the full list
of wanted packages and kdm does not end up on GNOME install because dm was resolved
before reaching gdm
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r-- | perl-install/install/pkgs.pm | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm index 1a4244d4a..2b08b2a42 100644 --- a/perl-install/install/pkgs.pm +++ b/perl-install/install/pkgs.pm @@ -155,7 +155,8 @@ sub _packageRequest { #- check for medium selection, if the medium has not been #- selected, the package cannot be selected. - !packageMedium($packages, $pkg)->{ignore} or return; + my $medium = packageMedium($packages, $pkg); + $medium and !$medium->{ignore} or return; +{ $pkg->id => 1 }; } @@ -373,18 +374,22 @@ sub setSelectedFromCompssList { my ($packages, $rpmsrate_flags_chosen, $min_level, $max_size) = @_; $rpmsrate_flags_chosen->{TRUE} = 1; #- ensure TRUE is set my $nb = selectedSize($packages); - foreach my $p (sort { $b->rate <=> $a->rate } @{$packages->{depslist}}) { + + my %pkgs = {}; + foreach my $p (@{$packages->{depslist}}) { my @flags = $p->rflags; - next if + next if !$p->rate || $p->rate < $min_level || - any { !any { /^!(.*)/ ? !$rpmsrate_flags_chosen->{$1} : $rpmsrate_flags_chosen->{$_} } split('\|\|') } @flags; - - #- determine the packages that will be selected when - #- selecting $p. the packages are not selected. + any { !any { /^!(.*)/ ? !$rpmsrate_flags_chosen->{$1} : $rpmsrate_flags_chosen->{$_} } split('\|\|') } @flags; + $pkgs{$p->rate} ||= {}; + $pkgs{$p->rate}{$p->id} = 1 if _packageRequest($packages, $p); + } + foreach my $level (sort { $b <=> $a } keys %pkgs) { + #- determine the packages that will be selected + #- the packages are not selected. my $state = $packages->{state} ||= {}; - - my ($l, $_error) = _resolve_requested_and_check($packages, $state, _packageRequest($packages, $p) || {}); - + my ($l, $_error) = _resolve_requested_and_check($packages, $state, $pkgs{$level}); + #- this enable an incremental total size. my $old_nb = $nb; foreach (@$l) { @@ -392,7 +397,7 @@ sub setSelectedFromCompssList { } if ($max_size && $nb > $max_size) { $nb = $old_nb; - $min_level = $p->rate; + $min_level = $level; $packages->disable_selected($packages->{rpmdb}, $state, @$l); last; } |