mherger wrote:
> > Yes, that's what I am wondering about.
I took the hard way and built a chroot to get Debian stable and Perl
5.20 running.
I have a behaviour difference when the version parser deals with the
locale.
Still in /usr/share/squeezeboxserver/CPAN/version/vpp.pm
Code:
--------------------
my $currlocale = POSIX::setlocale(&POSIX::LC_ALL);
my $radix_comma = ( POSIX::localeconv()->{decimal_point} eq ',' );
if ( not defined $value or $value =~ /^undef$/ ) {
# RT #19517 - special case for undef comparison
# or someone forgot to pass a value
push @{$self->{version}}, 0;
$self->{original} = "0";
return ($self);
}
if ( $#_ == 2 ) { # must be CVS-style
$value = 'v'.$_[2];
}
$value = _un_vstring($value);
# exponential notation
if ( $value =~ /\d+.?\d*e-?\d+/ ) {
$value = sprintf("%.9f",$value);
$value =~ s/(0+)$//;
}
# if the original locale used commas for decimal points, we
# just replace commas with decimal places, rather than changing
# locales
if ( $radix_comma ) {
$value =~ tr/,/./;
}
--------------------
the call to _un_vstring is what is changing the version value. And you
have some code that conditionally turns commas to dots that occurs only
after this function has been called, if $radix_comma evaluates to True.
Well, with Perl 5.20 and my fr_FR.UTF8 locale, $radix_comma evaluates to
False, whereas with Perl 5.22 it evaluates to True. This was maybe plain
wrong in 5.20, but at least coherent with the values themselves, as
"0.8" wouldn't be changed to "0,8" (by what, I don't know), which in
turn didn't trigger any issue.
But anyway, this code is called too late, damages have already been done
with 5.22. Now guess what happens in a recent version of version::vpp
Code:
--------------------
my $currlocale = 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 ',' ) {
$value =~ tr/,/./;
}
--------------------
So that is likely why updating version/vpp.pm and version.pm fixes
everything.
------------------------------------------------------------------------
kag's Profile: http://forums.slimdevices.com/member.php?userid=65602
View this thread: http://forums.slimdevices.com/showthread.php?t=105023
_______________________________________________
Squeezecenter mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/squeezecenter