summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
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 ];
}