From d27dc77d077cdc88dc4582eb5604c6a8ea1fc11d Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 16 Jan 2009 13:19:54 +0000 Subject: Handle kernel packages versionning in get_replaced_packages --- lib/Youri/Repository/Mandriva_upload.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/Youri/Repository/Mandriva_upload.pm b/lib/Youri/Repository/Mandriva_upload.pm index 5ee4640..05730b5 100644 --- a/lib/Youri/Repository/Mandriva_upload.pm +++ b/lib/Youri/Repository/Mandriva_upload.pm @@ -270,6 +270,25 @@ sub get_replaced_packages { ); } + # kernel packages have the version in the name + # binary dkms built for old kernels have to be removed too + + if ($name =~ /^kernel-([^\d]*)-([\d.]*)-(.*)$/) { # "desktop", "2.6.28", "2mnb" + push(@replaced_packages, + map { PACKAGE_CLASS->new(file => $_) } + $self->get_files( + $self->{_install_root}, + $self->get_install_path($package, $target, $user_context, $app_context), + PACKAGE_CLASS->get_pattern( + '(kernel-' . $1 . '-\d.*|.*-kernel-[\d.]*-' . $1 . '-\d.*)', + undef, + undef, + $package->get_arch() + ), + ) + ); + } + return @replaced_packages; } -- cgit v1.2.1