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) --- NEWS | 4 ++++ urpm/orphans.pm | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b7f758de..e6eaafbb 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +- library: + o prevent disabling removing orphan if we failed to detect running kernel + version + Version 7.27.3 - 30 May 2013, by Thierry Vignaud - library: 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