diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-06-11 17:48:21 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-10-04 09:25:26 +0200 |
commit | 42e6407e871b4f3350beea03fe660846c15cef5d (patch) | |
tree | 396eb666b627df1e12004e715b7522674d4ddeeb /urpm/orphans.pm | |
parent | cd9d6d1747874259df520ee2c6d9e35f1d1d05b9 (diff) | |
download | urpmi-42e6407e871b4f3350beea03fe660846c15cef5d.tar urpmi-42e6407e871b4f3350beea03fe660846c15cef5d.tar.gz urpmi-42e6407e871b4f3350beea03fe660846c15cef5d.tar.bz2 urpmi-42e6407e871b4f3350beea03fe660846c15cef5d.tar.xz urpmi-42e6407e871b4f3350beea03fe660846c15cef5d.zip |
prevent removing orphan kernels if we failed to detect running kernel version
(eg: running testsuite in a chroot)
Diffstat (limited to 'urpm/orphans.pm')
-rw-r--r-- | urpm/orphans.pm | 6 |
1 files changed, 5 insertions, 1 deletions
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 ]; } |