X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Flocale.t;h=c3a9d945b91718507af5ef04ea84f30a10e8c9f4;hb=4440d13a03087bebaa0394cf532fe7ebcda34a06;hp=037e2710e6bb6b79594a0a2d2078b22ad36056c4;hpb=d281a6ac99b66dc149fbd56ba67cd73e3e87afb9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/locale.t b/lib/locale.t index 037e271..c3a9d94 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -52,7 +52,7 @@ my $last = $have_setlocale ? &last : &last_without_setlocale; print "1..$last\n"; -use vars qw(&LC_ALL); +sub LC_ALL (); $a = 'abc %'; @@ -399,6 +399,17 @@ if (-x "/usr/bin/locale" && open(LOCALES, "/usr/bin/locale -a 2>/dev/null|")) { trylocale($_); } close(LOCALES); +} elsif ($^O eq 'openbsd' && -e '/usr/share/locale') { + + # OpenBSD doesn't have a locale executable, so reading /usr/share/locale + # is much easier and faster than the last resort method. + + opendir(LOCALES, '/usr/share/locale'); + while ($_ = readdir(LOCALES)) { + chomp; + trylocale($_); + } + close(LOCALES); } else { # This is going to be slow. @@ -437,6 +448,15 @@ if (-x "/usr/bin/locale" && open(LOCALES, "/usr/bin/locale -a 2>/dev/null|")) { setlocale(LC_ALL, "C"); +if ($^O eq 'darwin') { + # Darwin 8/Mac OS X 10.4 has bad Basque locales: perl bug #35895, + # Apple bug ID# 4139653. It also has a problem in Byelorussian. + if ($Config{osvers} ge '8' and $Config{osvers} lt '9') { + debug "# Skipping eu_ES, be_BY locales -- buggy in Darwin\n"; + @Locale = grep ! m/^(eu_ES|be_BY.CP1131$)/, @Locale; + } +} + @Locale = sort @Locale; debug "# Locales =\n";