From 9f8b646441830278ffe1ad01ce13380dadd2d2c0 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 6 Sep 2006 09:13:07 +0000 Subject: prefer kernel-source-stripped over kernel-source --- URPM/Resolve.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 6a2f96b..3ab1bd5 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -145,12 +145,30 @@ sub find_chosen_packages { push @chosen, $p; } + #- return immediately if there is only one chosen package + if (@chosen == 1) { return @chosen } + #- if several packages were selected to match a requested installation, #- and if --more-choices wasn't given, trim the choices to the first one. if (!$urpm->{options}{morechoices} && $install && @chosen > 1) { return ($chosen[0]); } + #- prefer kernel-source-stripped over kernel-source + { + my (@k_chosen, $stripped_kernel); + foreach my $p (@chosen) { + warn "*** ".$p->name; + if ($p->name =~ /^kernel-source-stripped/) { #- fast, but unportable + unshift @k_chosen, $p; + $stripped_kernel = 1; + } else { + push @k_chosen, $p; + } + } + return @k_chosen if $stripped_kernel; + } + #- Now we split @chosen in priority lists depending on locale. #- Packages that require locales-xxx when the corresponding locales are #- already installed should be preferred over packages that require locales -- cgit v1.2.1