diff options
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | urpm/orphans.pm | 11 |
2 files changed, 15 insertions, 0 deletions
@@ -1,3 +1,7 @@ +- orphans handling + o do not offer to remove current kernel (even if it's not a official + kernel + Version 6.27.1 - 18 August 2009 - make sure error messages are displayed (was broken as part of fix #50776) diff --git a/urpm/orphans.pm b/urpm/orphans.pm index aa7a2a19..a7f722f9 100644 --- a/urpm/orphans.pm +++ b/urpm/orphans.pm @@ -290,6 +290,13 @@ sub _will_prop_still_be_needed { }); } +# so that we can filter out current running kernel: +sub _get_current_kernel_package() { + my $release = (POSIX::uname())[2]; + `rpm -qf --qf '%{name}' /boot/vmlinuz-$release`; +} + + #- returns the list of "unrequested" orphans. #- #- side-effects: none @@ -302,6 +309,8 @@ sub _all_unrequested_orphans { push @{$provides{$_}}, $pkg foreach $pkg->provides_nosense; } + my $current_kernel = _get_current_kernel_package(); + while (my $pkg = shift @$req) { foreach my $prop ($pkg->requires, $pkg->suggests) { my $n = URPM::property2name($prop); @@ -314,6 +323,8 @@ sub _all_unrequested_orphans { } } + # do not offer to remove current kernel: + delete $l{$current_kernel}; [ values %l ]; } |