aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-25 16:16:17 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-25 16:16:17 +0000
commitc00350db4a4d3ea1025ca62bca1085b249619f55 (patch)
treece9ada705de6b7b9bfdcd03da02a4aea849b44bb
parent95d86918610308912c5d0a290a55566d7d65f656 (diff)
downloadperl-URPM-c00350db4a4d3ea1025ca62bca1085b249619f55.tar
perl-URPM-c00350db4a4d3ea1025ca62bca1085b249619f55.tar.gz
perl-URPM-c00350db4a4d3ea1025ca62bca1085b249619f55.tar.bz2
perl-URPM-c00350db4a4d3ea1025ca62bca1085b249619f55.tar.xz
perl-URPM-c00350db4a4d3ea1025ca62bca1085b249619f55.zip
- allow urpmi to know a package was not selected because a newer version is
installed (#29838)
-rw-r--r--NEWS2
-rw-r--r--URPM/Resolve.pm18
2 files changed, 17 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 1dd8f3b..67d83c3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- allow urpmi to know a package was not selected because a newer version is
+ installed (#29838)
- handle new package providing xxx which conflicts with an installed package (#17106)
- fix sort choices changed in perl-URPM 3.08
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 00d7812..2845407 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -630,6 +630,15 @@ sub _set_rejected_from {
}
#- side-effects: $state->{rejected}
+sub _set_rejected_old_package {
+ my ($state, $pkg, $new_pkg) = @_;
+
+ $pkg->fullname ne $new_pkg->fullname or return;
+
+ push @{$state->{rejected}{$pkg->fullname}{backtrack}{keep}}, scalar $new_pkg->fullname;
+}
+
+#- side-effects: $state->{rejected}
sub set_rejected {
my ($urpm, $state, $rdep) = @_;
@@ -811,6 +820,7 @@ sub resolve_requested__no_suggests {
#- + those of _handle_conflict ($state->{rejected})
#- + those of backtrack_selected_psel_keep (flag_requested, $state->{whatrequires})
#- + those of _handle_diff_provides (flag_requested, $state->{rejected}, $state->{whatrequires})
+#- + those of _no_more_recent_installed_and_providing ($state->{rejected})
sub resolve_requested__no_suggests_ {
my ($urpm, $db, $state, $requested, %options) = @_;
@@ -841,7 +851,7 @@ sub resolve_requested__no_suggests_ {
_set_flag_installed_and_upgrade_if_no_newer($db, $pkg);
if ($pkg->flag_installed && !$pkg->flag_upgrade) {
- _no_more_recent_installed_and_providing($urpm, $db, $pkg, $dep->{required}) or next;
+ _no_more_recent_installed_and_providing($urpm, $db, $state, $pkg, $dep->{required}) or next;
}
}
$urpm->{debug_URPM}("selecting " . $pkg->fullname) if $urpm->{debug_URPM};
@@ -1230,9 +1240,10 @@ sub _set_flag_installed_and_upgrade_if_no_newer {
$pkg->set_flag_upgrade($upgrade);
}
-#- side-effects: none
+#- side-effects:
+#- + those of _set_rejected_old_package ($state->{rejected})
sub _no_more_recent_installed_and_providing {
- my ($urpm, $db, $pkg, $required) = @_;
+ my ($urpm, $db, $state, $pkg, $required) = @_;
my $allow = 1;
$db->traverse_tag('name', [ $pkg->name ], sub {
@@ -1241,6 +1252,7 @@ sub _no_more_recent_installed_and_providing {
if ($allow && $pkg->compare_pkg($p) <= 0) {
if ($required =~ /^\d+/ || $p->provides_overlap($required)) {
$urpm->{debug_URPM}("not selecting " . $pkg->fullname . " since the more recent " . $p->fullname . " is installed") if $urpm->{debug_URPM};
+ _set_rejected_old_package($state, $pkg, $p);
$allow = 0;
} else {
$urpm->{debug_URPM}("the more recent " . $p->fullname .