aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Resolve.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-12 17:25:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-12 17:25:39 +0000
commit6c486f905b189e43ed10b1473a4ee4c2ed071d71 (patch)
tree4dcaa09b10956a3cb4419e193214b49197178781 /URPM/Resolve.pm
parent088aa884d4369bff024c76035173ffe4f2ae455d (diff)
downloadperl-URPM-6c486f905b189e43ed10b1473a4ee4c2ed071d71.tar
perl-URPM-6c486f905b189e43ed10b1473a4ee4c2ed071d71.tar.gz
perl-URPM-6c486f905b189e43ed10b1473a4ee4c2ed071d71.tar.bz2
perl-URPM-6c486f905b189e43ed10b1473a4ee4c2ed071d71.tar.xz
perl-URPM-6c486f905b189e43ed10b1473a4ee4c2ed071d71.zip
set_rejected() must do things even if _set_rejected_from has been done on the
same package. this removes the need for a special case
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r--URPM/Resolve.pm17
1 files changed, 9 insertions, 8 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 80509c4..033dbd0 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -522,6 +522,12 @@ sub _remove_rejected_from {
}
}
+#- useful to reject packages in advance
+#- eg when selecting "a" which conflict with "b", ensure we won't select "b"
+#- but it's somewhat dangerous because it's sometimes called on installed packages,
+#- and in that case, a real resolve_rejected_ must be done
+#- (that's why set_rejected ignores the effect of _set_rejected_from)
+#-
#- side-effects: $state->{rejected}
sub _set_rejected_from {
my ($state, $pkg, $from_pkg) = @_;
@@ -535,10 +541,10 @@ sub _set_rejected_from {
sub set_rejected {
my ($urpm, $state, $pkg, %options) = @_;
- my $newly_rejected = !$state->{rejected}{$pkg->fullname};
-
my $rv = $state->{rejected}{$pkg->fullname} ||= {};
+ my $newly_rejected = !exists $rv->{size};
+
if ($newly_rejected) {
$urpm->{debug_URPM}("set_rejected: " . $pkg->fullname) if $urpm->{debug_URPM};
#- keep track of size of package which are finally removed.
@@ -1016,13 +1022,8 @@ sub _handle_provides_overlap {
push @$keep, scalar $p->fullname;
} else {
#- no package has been found, we need to remove the package examined.
- my $obsoleted;
- #- force resolution (see urpmi test "handle-conflict-deps")
- if (my $prev = delete $state->{rejected}{$p->fullname}) {
- $obsoleted = $prev->{obsoleted};
- }
resolve_rejected_($urpm, $db, $state, $p, $properties,
- ($obsoleted ? 'obsoleted' : 'removed') => 1,
+ removed => 1,
from => $pkg,
why => { conflicts => $property },
);