From a6d655f5df5d2547c1effb70d5ce1e7b67d7a483 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Mon, 28 Sep 2009 15:47:46 +0000 Subject: Do not list as orphans kernel packages which where not installe through dependencies (#53425) --- urpm/orphans.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'urpm/orphans.pm') diff --git a/urpm/orphans.pm b/urpm/orphans.pm index c88c6fc3..1149fb16 100644 --- a/urpm/orphans.pm +++ b/urpm/orphans.pm @@ -312,7 +312,7 @@ sub _get_current_kernel_package() { # my (@requested_kernels, %kernels); sub _kernel_callback { - my ($pkg) = @_; + my ($pkg, %l) = @_; my $shortname = $pkg->name; my $n = $pkg->fullname; @@ -322,6 +322,9 @@ sub _kernel_callback { # only consider real kernels (and not kernel-doc and the like): return if $shortname =~ /-(?:source|doc|headers|firmware(?:|-extra))$/; + # ignore requested kernels + return unless %l->{$shortname}; + # keep track of latest kernels in order not to try removing requested kernels: if ($n =~ /latest/) { push @requested_kernels, $pkg->requires; @@ -356,7 +359,7 @@ sub _all_unrequested_orphans { while (my $pkg = shift @$req) { # do not do anything regarding kernels if we failed to detect the running one (ie: chroot) - _kernel_callback($pkg) if $current_kernel; + _kernel_callback($pkg, %l) if $current_kernel; foreach my $prop ($pkg->requires, $pkg->suggests) { my $n = URPM::property2name($prop); foreach my $p (@{$provides{$n} || []}) { -- cgit v1.2.1