From 42e6407e871b4f3350beea03fe660846c15cef5d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 11 Jun 2013 17:48:21 +0200 Subject: prevent removing orphan kernels if we failed to detect running kernel version (eg: running testsuite in a chroot) --- urpm/orphans.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'urpm') diff --git a/urpm/orphans.pm b/urpm/orphans.pm index 48d45754..9db0c1ef 100644 --- a/urpm/orphans.pm +++ b/urpm/orphans.pm @@ -442,7 +442,11 @@ sub _all_unrequested_orphans { # do not offer to remove current kernel or DKMS modules for current kernel: delete $l{$current_kernel}; - do { delete $l{$_} } foreach grep { /$current_kernel_version/ } keys %l; + # prevent removing orphan kernels if we failed to detect running kernel version: + if ($current_kernel_version) { + do { delete $l{$_} } foreach grep { /$current_kernel_version/ } keys %l; + } + [ values %l ]; } -- cgit v1.2.1