summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--urpm/orphans.pm15
2 files changed, 14 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 2ec35787..dd832298 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@
- do not cache media.cfg from the media when using a virtual one (ie a
medium for which we don't want to cache metadata)
- ignore gpg_pubkey packages in urpmq --not-available
+- fix not being able to remove orphan kernels due to dkms packages (#53414)
Version 6.32 - 29 October 2009
diff --git a/urpm/orphans.pm b/urpm/orphans.pm
index 8ad304fc..f2363bc2 100644
--- a/urpm/orphans.pm
+++ b/urpm/orphans.pm
@@ -312,14 +312,20 @@ sub _get_current_kernel_package() {
# do not care about (eg: kernel-devel, kernel-firmware, kernel-latest)
# so it's useless to look at them
#
-my (@latest_kernels, %kernels);
+my (@latest_kernels, %requested_kernels, %kernels);
sub _kernel_callback {
my ($pkg, $unreq_list) = @_;
my $shortname = $pkg->name;
my $n = $pkg->fullname;
# only consider kernels (and not main 'kernel' package):
- return if $shortname !~ /^kernel-/;
+ # but perform a pass on their requires for dkms like packages that require a specific kernel:
+ if ($shortname !~ /^kernel-/) {
+ foreach (grep { /^kernel/ } $pkg->requires) {
+ $requested_kernels{$_}{$shortname} = $pkg;
+ }
+ return;
+ }
# only consider real kernels (and not kernel-doc and the like):
return if $shortname =~ /-(?:source|doc|headers|firmware(?:|-extra))$/;
@@ -379,6 +385,11 @@ sub _all_unrequested_orphans {
my $a = { _get_orphan_kernels() };
add2hash_(\%l, $a);
+ # add packages that require orphan kernels to the list:
+ foreach (keys %$a) {
+ add2hash_(\%l, $requested_kernels{$_});
+ }
+
# do not offer to remove current kernel:
delete $l{$current_kernel};
[ values %l ];