aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-17 15:44:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-17 15:44:31 +0000
commit0ae9dd3c17c5d66a99d884d0e8bdb18566f9105c (patch)
treef943df0cfd3746e597eedc8f18dddb8d1f9fd128 /URPM
parentad57e64946089332f2968a2c74a3fb3596542ef7 (diff)
downloadperl-URPM-0ae9dd3c17c5d66a99d884d0e8bdb18566f9105c.tar
perl-URPM-0ae9dd3c17c5d66a99d884d0e8bdb18566f9105c.tar.gz
perl-URPM-0ae9dd3c17c5d66a99d884d0e8bdb18566f9105c.tar.bz2
perl-URPM-0ae9dd3c17c5d66a99d884d0e8bdb18566f9105c.tar.xz
perl-URPM-0ae9dd3c17c5d66a99d884d0e8bdb18566f9105c.zip
create _is_selected_or_installed() out of _score_for_locales()
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index c3ebd49..d4a9fb5 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -82,6 +82,13 @@ sub strict_arch_check {
1;
}
+sub _is_selected_or_installed {
+ my ($urpm, $db, $name) = @_;
+
+ (grep { $_->flag_available } $urpm->packages_providing($name)) > 0 ||
+ $db->traverse_tag('name', [ $name ], undef) > 0;
+}
+
# deprecated function name
sub find_chosen_packages { &find_required_package }
@@ -222,8 +229,7 @@ sub _score_for_locales {
my @r = $pkg->requires_nosense;
if (my ($specific_locales) = grep { /locales-(?!en)/ } @r) {
- if ((grep { $_->flag_available } $urpm->packages_providing($specific_locales)) > 0 ||
- $db->traverse_tag('name', [ $specific_locales ], undef) > 0) {
+ if (_is_selected_or_installed($urpm, $db, $specific_locales)) {
3; # good locale
} else {
0; # bad locale