From a961efea16a43cfead232052cec901ad7a464c6b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 13 Oct 2009 15:50:20 +0000 Subject: (_all_unrequested_orphans,_kernel_callback) fix commit ignoring kernel packages explicitely installed (aka not in /var/lib/rpm/installed-through-deps.list) (#53425) which r261072 by pterjan on 2009-09-28 tried to do now kernel orphans are handled again --- urpm/orphans.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'urpm') diff --git a/urpm/orphans.pm b/urpm/orphans.pm index 6c8ffd61..b53392e8 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, %l) = @_; + my ($pkg, $unreq_list) = @_; my $shortname = $pkg->name; my $n = $pkg->fullname; @@ -323,7 +323,7 @@ sub _kernel_callback { return if $shortname =~ /-(?:source|doc|headers|firmware(?:|-extra))$/; # ignore requested kernels (aka that are not in /var/lib/rpm/installed-through-deps.list) - return unless $l{$shortname}; + return if !$unreq_list->{$shortname} && $shortname !~ /latest/; # keep track of latest kernels in order not to try removing requested kernels: if ($n =~ /latest/) { @@ -354,12 +354,13 @@ sub _all_unrequested_orphans { $l{$pkg->name} = $pkg; push @{$provides{$_}}, $pkg foreach $pkg->provides_nosense; } + my $unreq_list = unrequested_list(); my $current_kernel = _get_current_kernel_package(); while (my $pkg = shift @$req) { # do not do anything regarding kernels if we failed to detect the running one (ie: chroot) - _kernel_callback($pkg, %l) if $current_kernel; + _kernel_callback($pkg, $unreq_list) if $current_kernel; foreach my $prop ($pkg->requires, $pkg->suggests) { my $n = URPM::property2name($prop); foreach my $p (@{$provides{$n} || []}) { -- cgit v1.2.1