aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Resolve.pm
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2010-02-12 15:58:28 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2010-02-12 15:58:28 +0000
commit8c4c9abb33c01c71834e6614b6dd16c23f53f069 (patch)
tree1abc2519c94efa8784e51ea9f5baff8d5c82b98a /URPM/Resolve.pm
parent79308c26b9ee2c3c5138c3f12c45f9c872b3e1ba (diff)
downloadperl-URPM-8c4c9abb33c01c71834e6614b6dd16c23f53f069.tar
perl-URPM-8c4c9abb33c01c71834e6614b6dd16c23f53f069.tar.gz
perl-URPM-8c4c9abb33c01c71834e6614b6dd16c23f53f069.tar.bz2
perl-URPM-8c4c9abb33c01c71834e6614b6dd16c23f53f069.tar.xz
perl-URPM-8c4c9abb33c01c71834e6614b6dd16c23f53f069.zip
check for conflicting selected packages before selecting a package
check for conflicting selected packages before selecting a package instead of after selecting it, to avoid having to unselect package in case of conflict (which incorrectly unselected packages with unsatisfied dependencies as well, making the following backtrack_selected call behave wrongly as it simply noticed that the package is no longer required) Here's the second patch again, now with the function comment updated and added _remove_all_rejected_from() call so that prerejections are still cleared (this was previously called from the removed disable_selected() call). Testsuites pass. Patch by Anssi Hannula, fixes #57224
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r--URPM/Resolve.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 4f8a9e1..3371991 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -968,6 +968,9 @@ sub resolve_requested__no_suggests_ {
_no_more_recent_installed_and_providing($urpm, $db, $state, $pkg, $dep->{required}) or next;
}
}
+
+ _handle_conflicts_with_selected($urpm, $db, $state, $pkg, $dep, \@properties, \@diff_provides, %options) or next;
+
$urpm->{debug_URPM}("selecting " . $pkg->fullname) if $urpm->{debug_URPM};
#- keep in mind the package has be selected, remove the entry in requested input hash,
@@ -990,8 +993,6 @@ sub resolve_requested__no_suggests_ {
_unselect_package_deprecated_by($urpm, $db, $state, \%diff_provides_h, $pkg);
}
- _handle_conflicts_with_selected($urpm, $db, $state, $pkg, $dep, \@properties, \@diff_provides, %options) or next;
-
#- all requires should be satisfied according to selected package, or installed packages.
if (my @l = unsatisfied_requires($urpm, $db, $state, $pkg)) {
$urpm->{debug_URPM}("requiring " . join(',', sort @l) . " for " . $pkg->fullname) if $urpm->{debug_URPM};
@@ -1045,7 +1046,7 @@ sub resolve_requested__no_suggests_ {
#- unselects $pkg if such a package is already selected
#- side-effects:
#- + those of _set_rejected_from ($state->{rejected})
-#- + those of disable_selected (flag_requested, flag_required, $state->{selected}, $state->{rejected}, $state->{whatrequires})
+#- + those of _remove_all_rejected_from ($state->{rejected})
#- + those of backtrack_selected ($state->{backtrack}, $state->{rejected}, $state->{selected}, $state->{whatrequires}, flag_requested, flag_required)
sub _handle_conflicts_with_selected {
my ($urpm, $db, $state, $pkg, $dep, $properties, $diff_provides, %options) = @_;
@@ -1056,7 +1057,7 @@ sub _handle_conflicts_with_selected {
$p->provides_overlap($_) or next;
if (exists $state->{selected}{$p->id}) {
$urpm->{debug_URPM}($pkg->fullname . " conflicts with already selected package " . $p->fullname) if $urpm->{debug_URPM};
- disable_selected($urpm, $db, $state, $pkg);
+ _remove_all_rejected_from($state, $pkg);
_set_rejected_from($state, $pkg, $p);
unshift @$properties, backtrack_selected($urpm, $db, $state, $dep, $diff_provides, %options);
return;