From de25323541727ae974b16eb83f24d9d873853a01 Mon Sep 17 00:00:00 2001 From: nordicdyno Date: Wed, 1 Aug 2012 14:51:01 +0400 Subject: [PATCH] Fix locale.t for Perls >= 5.10 and < 5.16 on new MacOS X 10.8 locale.t fail in Mac OS X Mountain Lion, because buggy locales --- lib/Devel/PatchPerl.pm | 74 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lib/Devel/PatchPerl.pm b/lib/Devel/PatchPerl.pm index 96db9b6..cb6be35 100644 --- a/lib/Devel/PatchPerl.pm +++ b/lib/Devel/PatchPerl.pm @@ -141,6 +141,14 @@ my @patch = ( perl => [ qr/^5\.8\.9$/, ], subs => [ [ \&_patch_589_perlio_c ], ], }, + { + perl => [ + qr/^5\.1[024]/, + ], + subs => [ + [ \&_patch_darwin_locale_test ], + ], + }, ); sub patch_source { @@ -1798,6 +1806,72 @@ sub _patch_589_perlio_c END } +sub _patch_darwin_locale_test +{ + my $perl = shift; + + if ($perl =~ /^5\.14/) { + _patch(<<'END'); +--- lib/locale.t ++++ lib/locale.t +@@ -460,7 +460,7 @@ + if ($v >= 8 and $v < 10) { + debug "# Skipping eu_ES, be_BY locales -- buggy in Darwin\n"; + @Locale = grep ! m/^(eu_ES(?:\..*)?|be_BY\.CP1131)$/, @Locale; +- } elsif ($v < 12) { ++ } elsif ($v <= 12) { + debug "# Skipping be_BY locales -- buggy in Darwin\n"; + @Locale = grep ! m/^be_BY\.CP1131$/, @Locale; + } +END + } + elsif ($perl =~ /^5\.12\.0/) { + _patch(<<'END'); +--- lib/locale.t ++++ lib/locale.t +@@ -460,7 +460,7 @@ + if ($v >= 8 and $v < 10) { + debug "# Skipping eu_ES, be_BY locales -- buggy in Darwin\n"; + @Locale = grep ! m/^(eu_ES|be_BY\.CP1131)$/, @Locale; +- } elsif ($v < 11) { ++ } elsif ($v <= 12) { + debug "# Skipping be_BY locales -- buggy in Darwin\n"; + @Locale = grep ! m/^be_BY\.CP1131$/, @Locale; + } +END + } + elsif ($perl =~ /^5\.12/) { + _patch(<<'END'); +--- lib/locale.t ++++ lib/locale.t +@@ -460,7 +460,7 @@ + if ($v >= 8 and $v < 10) { + debug "# Skipping eu_ES, be_BY locales -- buggy in Darwin\n"; + @Locale = grep ! m/^(eu_ES(?:\..*)?|be_BY\.CP1131)$/, @Locale; +- } elsif ($v < 11) { ++ } elsif ($v <= 12) { + debug "# Skipping be_BY locales -- buggy in Darwin\n"; + @Locale = grep ! m/^be_BY\.CP1131$/, @Locale; + } +END + } + elsif ($perl =~ /^5\.10/) { + _patch(<<'END'); +--- lib/locale.t ++++ lib/locale.t +@@ -460,6 +460,9 @@ + if ($v >= 8 and $v < 10) { + debug "# Skipping eu_ES, be_BY locales -- buggy in Darwin\n"; + @Locale = grep ! m/^(eu_ES|be_BY.CP1131$)/, @Locale; ++ } elsif ($v <= 12) { ++ debug "# Skipping be_BY locales -- buggy in Darwin\n"; ++ @Locale = grep ! m/^be_BY\.CP1131$/, @Locale; + } + } +END + } +} + qq[patchin']; =pod