aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-12 18:09:09 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-12 18:09:09 +0000
commita5341267cca3d84adcdca3fc09e58c551630edf9 (patch)
treee697f44b6d85c6e4f0710e2e98ea3c4a4782efbd
parent6b0af96a4166bdebc2724b6f37c72e0c5d2ba01f (diff)
downloadperl-URPM-a5341267cca3d84adcdca3fc09e58c551630edf9.tar
perl-URPM-a5341267cca3d84adcdca3fc09e58c551630edf9.tar.gz
perl-URPM-a5341267cca3d84adcdca3fc09e58c551630edf9.tar.bz2
perl-URPM-a5341267cca3d84adcdca3fc09e58c551630edf9.tar.xz
perl-URPM-a5341267cca3d84adcdca3fc09e58c551630edf9.zip
use set_rejected() in _compute_diff_provides_one(),
nb: the change is not neutral in the "unselected_uninstalled" case
-rw-r--r--URPM/Resolve.pm30
1 files changed, 16 insertions, 14 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 8b7c74f..40191c7 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -870,7 +870,8 @@ sub _compute_diff_provides {
keys %diff_provides;
}
-#- side-effects: $state->{rejected}, $state->{oldpackage}, $state->{unselected_uninstalled}
+#- side-effects: $state->{oldpackage}, $state->{unselected_uninstalled}
+#- + those of set_rejected ($state->{rejected})
#- + those of _set_rejected_from ($state->{rejected})
#- + those of disable_selected (flag_requested, flag_required, $state->{selected}, $state->{rejected}, $state->{whatrequires})
sub _compute_diff_provides_one {
@@ -899,14 +900,8 @@ sub _compute_diff_provides_one {
#- $satisfied is true if installed package has version newer or equal.
my $comparison = $p->compare($v);
my $satisfied = !$o || eval($comparison . $o . 0);
- $p->name eq $pkg->name || $satisfied or return;
-
- #- do not propagate now the broken dependencies as they are
- #- computed later.
- my $rv = $state->{rejected}{$p->fullname} ||= {};
- $rv->{closure}{$pkg->fullname} = undef;
- $rv->{size} = $p->size;
+ my $obsoleted;
if ($p->name eq $pkg->name) {
#- all packages older than the current one are obsoleted,
#- the others are simply removed (the result is the same).
@@ -922,18 +917,25 @@ sub _compute_diff_provides_one {
$state->{unselected_uninstalled} = [ grep {
!$_->flag_installed;
} disable_selected($urpm, $db, $state, $pkg) ];
+
+ return;
}
} elsif ($satisfied) {
- $rv->{obsoleted} = 1;
- } else {
- $rv->{closure}{$pkg->fullname} = { old_requested => 1 };
- $rv->{removed} = 1;
- ++$state->{oldpackage};
+ $obsoleted = 1;
}
+ } elsif ($satisfied) {
+ $obsoleted = 1;
} else {
- $rv->{obsoleted} = 1;
+ return;
}
+ set_rejected($urpm, $state, {
+ rejected_pkg => $p,
+ obsoleted => $obsoleted, removed => !$obsoleted,
+ from => $pkg, why => $obsoleted ? () : { old_requested => 1 },
+ });
+ $obsoleted or ++$state->{oldpackage};
+
#- diff_provides on obsoleted provides are needed.
foreach ($p->provides) {
#- check differential provides between obsoleted package and newer one.