aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-17 16:16:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-17 16:16:52 +0000
commit01c0dc37ff3188cb960a3e90cae8fda97c02cdd5 (patch)
tree09f691b60d0affe847ab877e9807308d4694e01f
parent0ae9dd3c17c5d66a99d884d0e8bdb18566f9105c (diff)
downloadperl-URPM-01c0dc37ff3188cb960a3e90cae8fda97c02cdd5.tar
perl-URPM-01c0dc37ff3188cb960a3e90cae8fda97c02cdd5.tar.gz
perl-URPM-01c0dc37ff3188cb960a3e90cae8fda97c02cdd5.tar.bz2
perl-URPM-01c0dc37ff3188cb960a3e90cae8fda97c02cdd5.tar.xz
perl-URPM-01c0dc37ff3188cb960a3e90cae8fda97c02cdd5.zip
- choose every kernel-<flavor>-devel-<version> packages when
kernel-<flavor>-<version> is selected
-rw-r--r--NEWS3
-rw-r--r--URPM/Resolve.pm29
2 files changed, 24 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index e93f704..fd145f1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- choose every kernel-<flavor>-devel-<version> packages when
+ kernel-<flavor>-<version> is selected
+
Version 2.01 - 14 September 2007, by Pascal "Pixel" Rigaux
- fix bug occurring with --keep
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index d4a9fb5..6406642 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -182,17 +182,30 @@ sub _find_required_package__sort {
}
#- prefer kernel-source-stripped over kernel-source
- {
- my (@k_chosen, $stripped_kernel);
- foreach my $p (@chosen) {
- if ($p->name =~ /^kernel-source-stripped/) { #- fast, but unportable
- unshift @k_chosen, $p;
- $stripped_kernel = 1;
+ if ($chosen[0]->name =~ /^kernel-(.*source-|.*-devel-)/) {
+
+ my @l = grep {
+ if ($_->name =~ /^kernel-.*source-stripped-(.*)/) {
+ my $version = quotemeta($1);
+ find {
+ $_->name =~ /-$version$/ && ($_->flag_installed || $_->flag_selected);
+ } $urpm->packages_providing('kernel');
+ } elsif ($_->name =~ /(kernel-.*)-devel-(.*)/) {
+ my $kernel = "$1-$2";
+ _is_selected_or_installed($urpm, $db, $kernel);
+ } elsif ($_->name =~ /^kernel-.*source-/) {
+ #- hopefully we don't have a media with kernel-source but not kernel-source-stripped nor kernel-.*-devel
+ 0;
} else {
- push @k_chosen, $p;
+ $urpm->{debug_URPM}("unknown kernel-source package " . $_->fullname) if $urpm->{debug_URPM};
+ 0;
}
+ } @chosen;
+
+ if (@l) {
+ $urpm->{debug_URPM}("packageCallbackChoices: kernel source chosen " . join(",", map { $_->name } @l) . " in " . join(",", map { $_->name } @chosen)) if $urpm->{debug_URPM};
+ return \@l, \@l;
}
- return \@k_chosen if $stripped_kernel;
}
if ($urpm->{media}) {