summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-07-16 17:41:01 +0000
committerFrancois Pons <fpons@mandriva.com>2002-07-16 17:41:01 +0000
commit1cdfc7247f9f4c5929175bd5c064e1c9d6e4df00 (patch)
tree5bdb242f468085393d17b27e7bc88a140740da67 /perl-install
parentea3c1e5a5f48c7cca5e919cf4aea2a2a28b5d590 (diff)
downloaddrakx-backup-do-not-use-1cdfc7247f9f4c5929175bd5c064e1c9d6e4df00.tar
drakx-backup-do-not-use-1cdfc7247f9f4c5929175bd5c064e1c9d6e4df00.tar.gz
drakx-backup-do-not-use-1cdfc7247f9f4c5929175bd5c064e1c9d6e4df00.tar.bz2
drakx-backup-do-not-use-1cdfc7247f9f4c5929175bd5c064e1c9d6e4df00.tar.xz
drakx-backup-do-not-use-1cdfc7247f9f4c5929175bd5c064e1c9d6e4df00.zip
update with newer perl-URPM.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/pkgs.pm22
1 files changed, 12 insertions, 10 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index e14a709c6..b8ba6d702 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -287,7 +287,7 @@ sub selectPackage {
my $state = $packages->{state} ||= {};
$state->{selected} = {};
$state->{requested} = packageRequest($packages, $pkg) or return;
- $packages->resolve_requested($packages->{rpmdb}, $state, no_flag_update => $otherOnly, clear_state => $otherOnly,
+ $packages->resolve_requested($packages->{rpmdb}, $state, no_flag_update => $otherOnly, keep_state => $otherOnly,
callback_choices => \&packageCallbackChoices);
if ($base || $otherOnly) {
@@ -322,7 +322,7 @@ sub unselectPackage($$;$) {
my $state = $packages->{state} ||= {};
$state->{selected} = { $pkg->id };
$state->{requested} = {};
- $packages->resolve_requested($packages->{rpmdb}, $state, clear_state => 1);
+ $packages->resolve_requested($packages->{rpmdb}, $state, keep_state => 1);
}
1;
}
@@ -346,11 +346,11 @@ sub unselectAllPackages($) {
$selected{$_->id} = undef;
}
}
- if (%selected) {
+ if (%selected && %{$packages->{state} || {}}) {
my $state = $packages->{state} ||= {};
$state->{selected} = \%selected;
$state->{requested} = {};
- $packages->resolve_requested($packages->{rpmdb}, $state, clear_state => 1);
+ $packages->resolve_requested($packages->{rpmdb}, $state, keep_state => 1);
}
}
sub unselectAllPackagesIncludingUpgradable($) {
@@ -363,11 +363,11 @@ sub unselectAllPackagesIncludingUpgradable($) {
$selected{$_->id} = undef;
}
}
- if (%selected) {
+ if (%selected && %{$packages->{state} || {}}) {
my $state = $packages->{state} ||= {};
$state->{selected} = \%selected;
$state->{requested} = {};
- $packages->resolve_requested($packages->{rpmdb}, $state, clear_state => 1);
+ $packages->resolve_requested($packages->{rpmdb}, $state, keep_state => 1);
}
}
@@ -781,7 +781,7 @@ sub setSelectedFromCompssList {
$nb = $old_nb;
$min_level = $p->rate;
$state->{requested} = {}; #- ensure no newer package will be selected.
- $packages->resolve_requested($packages->{rpmdb}, $state, clear_state => 1);
+ $packages->resolve_requested($packages->{rpmdb}, $state, keep_state => 1); #- FIXME INCOMPLETE TODO
last;
}
@@ -800,17 +800,19 @@ sub setSelectedFromCompssList {
#- just saves the selected packages, call setSelectedFromCompssList and restores the selected packages
sub saveSelected {
my ($packages) = @_;
+ my $state = delete $packages->{state};
my @l = @{$packages->{depslist}};
my @flags = map { ($_->flag_requested && 1) + ($_->flag_required && 2) + ($_->flag_upgrade && 4) } @l;
- [ $packages, \@l, \@flags ];
+ [ $packages, $state, \@l, \@flags ];
}
sub restoreSelected {
- my ($packages, $l, $flags) = @{$_[0]};
+ my ($packages, $state, $l, $flags) = @{$_[0]};
+ $packages->{state} = $state;
mapn { my ($pkg, $flag) = @_;
$pkg->set_flag_requested($flag & 1);
$pkg->set_flag_required($flag & 2);
$pkg->set_flag_upgrade($flag & 4);
- } $l, $flags;
+ } $l, $flags;
}
sub computeGroupSize {