From ba3766567c585e7e344cff2dc9c258dc14d34c86 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sat, 5 Jun 2010 21:23:50 +0000 Subject: (countries_to_locales) further fix listing locales (#58543 bis, from herton too) localedrake expects YET in anoter placeS that we always have xx_XX and xx_XX.UTF-8. But since 2010.1, the locales package was changed to only provide default glibc locales (plus only some new locales which are exceptions), before we had redundant but always a xx_XX dir created. --- perl-install/lang.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'perl-install/lang.pm') diff --git a/perl-install/lang.pm b/perl-install/lang.pm index f48e05320..9f7d95ab8 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -185,7 +185,7 @@ sub l2language { exists $langs{$_[0]} && $langs{$_[0]}[5] } sub is_locale_installed { my ($locale) = @_; - my @ctypes = glob "/usr/share/locale/" . l2locale($locale) . "{,.*}/LC_CTYPE"; + my @ctypes = glob "/usr/share/locale/" . $locale . "{,.*}/LC_CTYPE"; foreach my $ctype (@ctypes) { -e $ctype && return 1 } 0; } @@ -193,7 +193,7 @@ sub is_locale_installed { sub list_langs { my (%options) = @_; my @l = keys %langs; - $options{exclude_non_installed} ? grep { is_locale_installed($_) } @l : @l; + $options{exclude_non_installed} ? grep { is_locale_installed(l2locale($_)) } @l : @l; } sub text_direction_rtl() { @@ -536,7 +536,7 @@ sub countries_to_locales { my $may_add = sub { my ($locale, $country) = @_; if ($options{exclude_non_installed}) { - -e "/usr/share/locale/$locale/LC_CTYPE" or return; + is_locale_installed($locale) or return; } my $h = analyse_locale_name($locale) or internal_error(); push @{$country2locales{$country || $h->{country}}}, $h; -- cgit v1.2.1