summaryrefslogtreecommitdiffstats
path: root/urpm/orphans.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-01-05 12:45:39 +0000
committerThierry Vignaud <tv@mandriva.org>2010-01-05 12:45:39 +0000
commit9224b65b1a7030a4fd8a0f9c734aecff723c8a21 (patch)
treef7ae0a112d7056500a4226ed0adf858a27f38e6f /urpm/orphans.pm
parentddfb5d2b8d3a7005bfabf301188fecd51a721101 (diff)
downloadurpmi-9224b65b1a7030a4fd8a0f9c734aecff723c8a21.tar
urpmi-9224b65b1a7030a4fd8a0f9c734aecff723c8a21.tar.gz
urpmi-9224b65b1a7030a4fd8a0f9c734aecff723c8a21.tar.bz2
urpmi-9224b65b1a7030a4fd8a0f9c734aecff723c8a21.tar.xz
urpmi-9224b65b1a7030a4fd8a0f9c734aecff723c8a21.zip
(_kernel_callback) add packages requiring orphan kernels to the orphan
lists too, eg dkms packages (#53414)
Diffstat (limited to 'urpm/orphans.pm')
-rw-r--r--urpm/orphans.pm15
1 files changed, 13 insertions, 2 deletions
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 ];