summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-06-11 17:48:21 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-10-04 09:25:26 +0200
commit42e6407e871b4f3350beea03fe660846c15cef5d (patch)
tree396eb666b627df1e12004e715b7522674d4ddeeb
parentcd9d6d1747874259df520ee2c6d9e35f1d1d05b9 (diff)
downloadurpmi-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)
-rw-r--r--NEWS4
-rw-r--r--urpm/orphans.pm6
2 files changed, 9 insertions, 1 deletions
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 ];
}