diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-08-20 14:06:38 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-08-20 14:06:38 +0000 |
commit | ab7fd8391ba5ba3210a76e69b3f038546b059b68 (patch) | |
tree | d15d1345d1f4e4b84b0ba16bd4f815eedfa427b7 | |
parent | 574628e3850ba0475e9e8e5e21697135ba92ec00 (diff) | |
download | urpmi-ab7fd8391ba5ba3210a76e69b3f038546b059b68.tar urpmi-ab7fd8391ba5ba3210a76e69b3f038546b059b68.tar.gz urpmi-ab7fd8391ba5ba3210a76e69b3f038546b059b68.tar.bz2 urpmi-ab7fd8391ba5ba3210a76e69b3f038546b059b68.tar.xz urpmi-ab7fd8391ba5ba3210a76e69b3f038546b059b68.zip |
(_get_current_kernel_package,_all_unrequested_orphans) do not offer to remove current kernel
-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 ]; } |