diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-10-15 16:23:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-10-15 16:23:27 +0000 |
commit | 7339563f8549c735b18d8609ca9546b5bdc6d538 (patch) | |
tree | 94502ae3dfc56ed2d22464e6d5f16cdf217a70c5 /urpm/orphans.pm | |
parent | a93c0cf7864afd4108deac8f094270e97a7e0f21 (diff) | |
download | urpmi-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/orphans.pm')
-rw-r--r-- | urpm/orphans.pm | 8 |
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 ]; } |