summaryrefslogtreecommitdiffstats
path: root/urpm
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 /urpm
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
Diffstat (limited to 'urpm')
-rw-r--r--urpm/orphans.pm11
1 files changed, 11 insertions, 0 deletions
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 ];
}