aboutsummaryrefslogtreecommitdiffstats
path: root/URPM/Resolve.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-09-06 09:13:07 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-09-06 09:13:07 +0000
commit9f8b646441830278ffe1ad01ce13380dadd2d2c0 (patch)
tree05cef1f659786f779dfc8ab0647d83fa806029a6 /URPM/Resolve.pm
parent43335ddfcd9e3cb59b292edde9363bfcb37e403f (diff)
downloadperl-URPM-9f8b646441830278ffe1ad01ce13380dadd2d2c0.tar
perl-URPM-9f8b646441830278ffe1ad01ce13380dadd2d2c0.tar.gz
perl-URPM-9f8b646441830278ffe1ad01ce13380dadd2d2c0.tar.bz2
perl-URPM-9f8b646441830278ffe1ad01ce13380dadd2d2c0.tar.xz
perl-URPM-9f8b646441830278ffe1ad01ce13380dadd2d2c0.zip
prefer kernel-source-stripped over kernel-source
Diffstat (limited to 'URPM/Resolve.pm')
-rw-r--r--URPM/Resolve.pm18
1 files changed, 18 insertions, 0 deletions
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