summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-07-21 14:50:18 +0000
committerFrancois Pons <fpons@mandriva.com>2003-07-21 14:50:18 +0000
commit1b9fc74443a32bed1a877f19aafff3efe28093d8 (patch)
tree8e558c541b696788fea0bfec7d51af8463c33fed
parent4508da712a6b01cce1f9edbcdf38e6f0fc0a561a (diff)
downloaddrakx-1b9fc74443a32bed1a877f19aafff3efe28093d8.tar
drakx-1b9fc74443a32bed1a877f19aafff3efe28093d8.tar.gz
drakx-1b9fc74443a32bed1a877f19aafff3efe28093d8.tar.bz2
drakx-1b9fc74443a32bed1a877f19aafff3efe28093d8.tar.xz
drakx-1b9fc74443a32bed1a877f19aafff3efe28093d8.zip
fixed setSelectedFromCompssList (updated with newer perl-URPM interface),
more need to be done. maybe increased speed of unselectAllPackages.
-rw-r--r--perl-install/pkgs.pm26
1 files changed, 9 insertions, 17 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index c7ce0e1bb..74cf1e870 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -296,27 +296,21 @@ sub setPackageSelection($$$) {
sub unselectAllPackages($) {
my ($packages) = @_;
- my (%keep_selected, %unselected);
+ my %keep_selected;
foreach (@{$packages->{depslist}}) {
if ($_->flag_base || $_->flag_installed && $_->flag_selected) {
#- keep track of package that should be kept selected.
$keep_selected{$_->id} = $_;
} else {
#- deselect all packages except base or packages that need to be upgraded.
- $unselected{$_->id} = $_;
- }
- }
- if (%unselected) {
- my $state = $packages->{state} ||= {};
- $packages->disable_selected($packages->{rpmdb}, $state, values %unselected);
-
- if (my @l = $packages->resolve_requested($packages->{rpmdb}, $state, \%keep_selected,
- callback_choices => \&packageCallbackChoices)) {
- foreach (@l) {
- log::l("unselectAllPackage unselected ".$_->fullname." which has been selected again");
- }
+ $_->set_flag_required(0);
+ $_->set_flag_requested(0);
}
}
+ #- clean staten, in order to start with a brand new set...
+ $packages->{state} = {};
+ $packages->resolve_requested($packages->{rpmdb}, $packages->{state}, \%keep_selected,
+ callback_choices => \&packageCallbackChoices);
}
sub psUpdateHdlistsDeps {
@@ -573,16 +567,14 @@ sub setSelectedFromCompssList {
#- determine the packages that will be selected when
#- selecting $p. the packages are not selected.
my $state = $packages->{state} ||= {};
- $state->{selected} = {};
my @l = $packages->resolve_requested($packages->{rpmdb}, $state, packageRequest($packages, $p) || {},
callback_choices => \&packageCallbackChoices);
#- this enable an incremental total size.
my $old_nb = $nb;
- foreach (keys %{$state->{selected}}) {
- my $p = $packages->{depslist}[$_] or next;
- $nb += $p->size;
+ foreach (@l) {
+ $nb += $_->size;
}
if ($max_size && $nb > $max_size) {
$nb = $old_nb;