summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-10-28 16:00:52 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-10-28 16:00:52 +0000
commit04b01ef7b2a068fb5ead186a5d19fa1ca2e766b7 (patch)
treed8ed6f13b7ec21955ae2887b95522b4be71e2d4b /urpm
parentd89f830f94cd285a6b4101a64dbe385d0c188b95 (diff)
downloadurpmi-04b01ef7b2a068fb5ead186a5d19fa1ca2e766b7.tar
urpmi-04b01ef7b2a068fb5ead186a5d19fa1ca2e766b7.tar.gz
urpmi-04b01ef7b2a068fb5ead186a5d19fa1ca2e766b7.tar.bz2
urpmi-04b01ef7b2a068fb5ead186a5d19fa1ca2e766b7.tar.xz
urpmi-04b01ef7b2a068fb5ead186a5d19fa1ca2e766b7.zip
be careful when an obsoleted package is listed in potential orphans
When package B obsoletes package A and package A is listed as a potential orphan (ie it appears in installed-through-deps.list), then B is marked as a potential orphan too (since "obsoletes" more or less means that A was renamed to B). However, if B was originally installed and does not appear in installed-through-deps, that means it's not a potential orphan and thus it shouldn't be added to the potential orphans list. Fixes #54590.
Diffstat (limited to 'urpm')
-rw-r--r--urpm/orphans.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/urpm/orphans.pm b/urpm/orphans.pm
index b53392e8..9b41bd5e 100644
--- a/urpm/orphans.pm
+++ b/urpm/orphans.pm
@@ -130,7 +130,7 @@ sub _selected_unrequested {
#-
#- side-effects: none
sub _renamed_unrequested {
- my ($urpm, $rejected) = @_;
+ my ($urpm, $selected, $rejected) = @_;
my @obsoleted = grep { $rejected->{$_}{obsoleted} } keys %$rejected or return;
@@ -144,6 +144,8 @@ sub _renamed_unrequested {
my ($new_fn) = keys %{$rejected->{$fn}{closure}};
my ($new_n) = $new_fn =~ $fullname2name_re;
+
+ grep { my $pkg = $urpm->{depslist}[$_]; ($pkg->name eq $new_n) && $pkg->flag_installed && $pkg->flag_upgrade } keys %$selected and next;
if ($new_n ne $n) {
$l{$new_n} = "(obsoletes $fn)";
}
@@ -154,7 +156,7 @@ sub new_unrequested {
my ($urpm, $state) = @_;
(
_selected_unrequested($urpm, $state->{selected}, $state->{rejected}),
- _renamed_unrequested($urpm, $state->{rejected}),
+ _renamed_unrequested($urpm, $state->{selected}, $state->{rejected}),
);
}
#- side-effects: <root>/var/lib/rpm/installed-through-deps.list