summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-08-20 14:06:38 +0000
committerThierry Vignaud <tv@mandriva.org>2009-08-20 14:06:38 +0000
commitab7fd8391ba5ba3210a76e69b3f038546b059b68 (patch)
treed15d1345d1f4e4b84b0ba16bd4f815eedfa427b7
parent574628e3850ba0475e9e8e5e21697135ba92ec00 (diff)
downloadurpmi-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--NEWS4
-rw-r--r--urpm/orphans.pm11
2 files changed, 15 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index a895c43a..5d6bcd63 100644
--- a/NEWS
+++ b/NEWS
@@ -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 ];
}