summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-15 16:23:27 +0000
committerThierry Vignaud <tv@mageia.org>2012-10-15 16:23:27 +0000
commit7339563f8549c735b18d8609ca9546b5bdc6d538 (patch)
tree94502ae3dfc56ed2d22464e6d5f16cdf217a70c5 /urpm
parenta93c0cf7864afd4108deac8f094270e97a7e0f21 (diff)
downloadurpmi-7339563f8549c735b18d8609ca9546b5bdc6d538.tar
urpmi-7339563f8549c735b18d8609ca9546b5bdc6d538.tar.gz
urpmi-7339563f8549c735b18d8609ca9546b5bdc6d538.tar.bz2
urpmi-7339563f8549c735b18d8609ca9546b5bdc6d538.tar.xz
urpmi-7339563f8549c735b18d8609ca9546b5bdc6d538.zip
(_get_current_kernel_package) return current kernel version too
(_all_unrequested_orphans) prevent offering to remove DKMS modules for current kernel (mga#5092)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/orphans.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/urpm/orphans.pm b/urpm/orphans.pm
index e056d105..e389bded 100644
--- a/urpm/orphans.pm
+++ b/urpm/orphans.pm
@@ -347,7 +347,7 @@ sub _will_prop_still_be_needed {
sub _get_current_kernel_package() {
my $release = (POSIX::uname())[2];
# --qf '%{name}' is used in order to provide the right format:
- -e "/boot/vmlinuz-$release" && `rpm -qf --qf '%{name}' /boot/vmlinuz-$release`;
+ -e "/boot/vmlinuz-$release" && ($release, `rpm -qf --qf '%{name}' /boot/vmlinuz-$release`);
}
@@ -415,7 +415,7 @@ sub _all_unrequested_orphans {
}
my $unreq_list = unrequested_list($urpm);
- my $current_kernel = _get_current_kernel_package();
+ my ($current_kernel_version, $current_kernel) = _get_current_kernel_package();
while (my $pkg = shift @$req) {
# do not do anything regarding kernels if we failed to detect the running one (ie: chroot)
@@ -440,8 +440,8 @@ sub _all_unrequested_orphans {
add2hash_(\%l, $requested_kernels{$_});
}
- # do not offer to remove current kernel:
- delete $l{$current_kernel};
+ # do not offer to remove current kernel or DKMS modules for current kernel:
+ do { delete $l{$_} } foreach grep { /$current_kernel_version/ } keys %l;
[ values %l ];
}