diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-09-17 15:44:31 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-09-17 15:44:31 +0000 |
commit | 0ae9dd3c17c5d66a99d884d0e8bdb18566f9105c (patch) | |
tree | f943df0cfd3746e597eedc8f18dddb8d1f9fd128 | |
parent | ad57e64946089332f2968a2c74a3fb3596542ef7 (diff) | |
download | perl-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()
-rw-r--r-- | URPM/Resolve.pm | 10 |
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 |