aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-30 06:10:00 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-30 06:10:00 +0000
commit88de03498f989316d3ab721b58a343d4ea9e68e6 (patch)
treee62df9e27047adbc0f0d4263bcf612ecb00184e2 /URPM
parent60870d96de058efa9476f6ef6e1135732ae11679 (diff)
downloadperl-URPM-88de03498f989316d3ab721b58a343d4ea9e68e6.tar
perl-URPM-88de03498f989316d3ab721b58a343d4ea9e68e6.tar.gz
perl-URPM-88de03498f989316d3ab721b58a343d4ea9e68e6.tar.bz2
perl-URPM-88de03498f989316d3ab721b58a343d4ea9e68e6.tar.xz
perl-URPM-88de03498f989316d3ab721b58a343d4ea9e68e6.zip
Resolution of requested packages: by default, don't propose a choice when
multiple found packages are already installed.
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 1046be7..616206c 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -35,12 +35,12 @@ sub find_chosen_packages {
my %packages;
#- search for possible packages, try to be as fast as possible, backtrack can be longer.
- foreach (split '\|', $dep) {
+ foreach (split /\|/, $dep) {
if (/^\d+$/) {
my $pkg = $urpm->{depslist}[$_];
$pkg->arch eq 'src' || $pkg->is_arch_compat or next;
$pkg->flag_skip || $state->{rejected}{$pkg->fullname} and next;
- #- determine if this packages is better than a possibly previously chosen package.
+ #- determine if this package is better than a possibly previously chosen package.
$pkg->flag_selected || exists $state->{selected}{$pkg->id} and return $pkg;
if (my $p = $packages{$pkg->name}) {
$pkg->flag_requested > $p->flag_requested ||
@@ -103,6 +103,9 @@ sub find_chosen_packages {
push @chosen, $p;
}
+ #- if several packages are installed, trim the choices.
+ if (!$urpm->{options}{morechoices} && $mode == 3 && @chosen > 1) { @chosen = ($chosen[0]) }
+
#- packages that require locales-xxx when the corresponding locales are
#- already installed should be preferred over packages that require locales
#- which are not installed.
@@ -118,6 +121,7 @@ sub find_chosen_packages {
push @chosen_other, $_;
}
}
+
#- sort packages in order to have preferred ones first
#- (this means good locales, no locales, bad locales).
return (sort { $a->id <=> $b->id } @chosen_good_locales),