Subject: | [PATCH] Android doesn't support POSIX::localeconv() |
version module doesn't work on Android. Its libc doesn't provide localeconf() function.
This is patch:
--- version-0.9906/t/07locale.t
+++ version-0.9906_01/t/07locale.t
@@ -36,10 +36,10 @@
while (<DATA>) {
chomp;
$loc = setlocale( LC_ALL, $_);
- last if $loc && localeconv()->{decimal_point} eq ',';
+ last if $loc && eval { localeconv()->{decimal_point} eq ',' };
}
skip 'Cannot test locale handling without a comma locale', 5
- unless $loc and localeconv()->{decimal_point} eq ',';
+ unless $loc and eval { localeconv()->{decimal_point} eq ',' };
setlocale(LC_NUMERIC, $loc);
$ver = 1.23; # has to be floating point number
--- version-0.9906/t/survey_locales
+++ version-0.9906_01/t/survey_locales
@@ -9,7 +9,7 @@
while (<$LOCALES>) {
chomp;
$loc = setlocale( LC_ALL, $_);
- print $_ if localeconv()->{decimal_point} eq ',';
+ print $_ if eval { localeconv()->{decimal_point} eq ',' };
}
close $LOCALES;
$loc = setlocale( LC_ALL, $orig_loc);
--- version-0.9906/vperl/vpp.pm
+++ version-0.9906_01/vperl/vpp.pm
@@ -654,12 +654,12 @@
return $self;
}
- my $currlocale = setlocale(LC_ALL);
+ my $currlocale = do { local $@; local $SIG{__DIE__}; eval { setlocale(LC_ALL) } };
# if the current locale uses commas for decimal points, we
# just replace commas with decimal places, rather than changing
# locales
- if ( localeconv()->{decimal_point} eq ',' ) {
+ if ( do { local $@; local $SIG{__DIE__}; eval { localeconv()->{decimal_point} eq ',' } } ) {
$value =~ tr/,/./;
}