summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2010-05-11 13:17:06 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2010-05-11 13:17:06 +0000
commit1b4d9aa29ac0b7c21ff69b5f072b48b4217d07ce (patch)
treec56c6aee2cb7858666440f59886e3cdb1de270fb
parent59c8d29f27b3f86713ddbeb63d2dc1a5d4b4c412 (diff)
downloadurpmi-1b4d9aa29ac0b7c21ff69b5f072b48b4217d07ce.tar
urpmi-1b4d9aa29ac0b7c21ff69b5f072b48b4217d07ce.tar.gz
urpmi-1b4d9aa29ac0b7c21ff69b5f072b48b4217d07ce.tar.bz2
urpmi-1b4d9aa29ac0b7c21ff69b5f072b48b4217d07ce.tar.xz
urpmi-1b4d9aa29ac0b7c21ff69b5f072b48b4217d07ce.zip
(_kernel_callback) add packages requiring orphan kernels to the orphan
lists too, eg dkms packages (#53414)
-rw-r--r--NEWS1
-rw-r--r--urpm/orphans.pm15
2 files changed, 14 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index e3eab319..6caf3215 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,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 ];