r4621 - in /packages/libversion-perl/branches/upstream/current: Changes META.yml Makefile.PL README lib/version.pm t/01base.t t/02derived.t t/coretests.pm vperl/vpp.pm vutil/lib/version/vxs.pm vutil/vutil.c vutil/vxs.xs

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Wed Dec 13 16:45:21 CET 2006


Author: eloy
Date: Wed Dec 13 16:45:21 2006
New Revision: 4621

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=4621
Log:
Load /tmp/tmp.IiFIL21168/libversion-perl-1:0.68 into
packages/libversion-perl/branches/upstream/current.

Modified:
    packages/libversion-perl/branches/upstream/current/Changes
    packages/libversion-perl/branches/upstream/current/META.yml
    packages/libversion-perl/branches/upstream/current/Makefile.PL
    packages/libversion-perl/branches/upstream/current/README
    packages/libversion-perl/branches/upstream/current/lib/version.pm
    packages/libversion-perl/branches/upstream/current/t/01base.t
    packages/libversion-perl/branches/upstream/current/t/02derived.t
    packages/libversion-perl/branches/upstream/current/t/coretests.pm
    packages/libversion-perl/branches/upstream/current/vperl/vpp.pm
    packages/libversion-perl/branches/upstream/current/vutil/lib/version/vxs.pm
    packages/libversion-perl/branches/upstream/current/vutil/vutil.c
    packages/libversion-perl/branches/upstream/current/vutil/vxs.xs

Modified: packages/libversion-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/Changes?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/Changes (original)
+++ packages/libversion-perl/branches/upstream/current/Changes Wed Dec 13 16:45:21 2006
@@ -1,3 +1,23 @@
+2006-10-29  John Peacock <jpeacock at cpan.org>
+
+	Release 0.68 to CPAN with locale tests.
+
+2006-10-08  John Peacock <jpeacock at cpan.org>
+
+	I was wrong.  Apparently all releases of Perl require you to force the PV
+	to be regenerated after changing the locale.
+
+2006-10-08  John Peacock <jpeacock at cpan.org>
+
+	Lots of changes.  Problems noted in bleadperl because of locales which use
+	commas for the decimal point.  Both XS and Perl code updated to handle
+	this, which was tricky for the latter because locale handling was so bad
+	prior to 5.8.0.  Harmless warning during testing caused by bad interaction
+	between POSIX and Test::More's AUTOLOAD (no idea how to fix it).
+
+	Also bumped up required versions in tests and updated Makefile.PL to
+	correctly install the POD file.
+
 2006-08-16  John Peacock <jpeacock at cpan.org>
 
 	Use default subclass name in Build.PL, since M::B nukes the version::

Modified: packages/libversion-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/META.yml?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/META.yml (original)
+++ packages/libversion-perl/branches/upstream/current/META.yml Wed Dec 13 16:45:21 2006
@@ -1,11 +1,23 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         version
-version:      0.6701
-version_from: lib/version.pm
-installdirs:  site
+---
+name: version
+version: 0.68
+author:
+  - 'John Peacock E<lt>jpeacock at cpan.orgE<gt>'
+abstract: Perl extension for Version Objects
+license: perl
+resources:
+  license: http://dev.perl.org/licenses/
 requires:
-    Test::More:                    0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.30
+  perl: '> 5.005, < 5.009'
+dynamic_config: 1
+provides:
+  version:
+    file: lib/version.pm
+    version: 0.68
+  version::vxs:
+    file: vutil/lib/version/vxs.pm
+    version: 0.68
+generated_by: Module::Build version 0.2805
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.2.html
+  version: 1.2

Modified: packages/libversion-perl/branches/upstream/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/Makefile.PL?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/Makefile.PL (original)
+++ packages/libversion-perl/branches/upstream/current/Makefile.PL Wed Dec 13 16:45:21 2006
@@ -49,10 +49,11 @@
                    ), 
 
                    MAN3PODS       =>
-                       {'lib/version.pod' => 'blib/man3/version.3' },
+                      {'lib/version.pod' => 'blib/man3/version.3' },
 
                    PM              => 
-                       {'lib/version.pm' => '$(INST_LIBDIR)/version.pm'},
+                       {'lib/version.pm'  => '$(INST_LIBDIR)/version.pm',
+                        'lib/version.pod' => '$(INST_LIBDIR)/version.pod'},
                    PL_FILES        => {},
 
                    clean           => { FILES => 'vutil/Makefile.PL' },

Modified: packages/libversion-perl/branches/upstream/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/README?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/README (original)
+++ packages/libversion-perl/branches/upstream/current/README Wed Dec 13 16:45:21 2006
@@ -1,4 +1,4 @@
-version 0.6701
+version 0.68
 ==================================
 
 Provides the same version objects as included in Perl v5.9.x (and hopefully in
@@ -10,12 +10,11 @@
 order to get the current changes (the CPAN release has no effect in
 bleadperl).
 
-Minor changes in 0.6701 - 2006-08-16
+Major changes in 0.68 - 2006-10-29
 =====================================
 
-Another Build.PL tweak for Module::Build 0.2805, which nukes the version::
-namespace during the test for an installed release of version.pm.  This
-makes it impossible to install version.pm from CPAN with M::B.
+Properly handle locales which utilize commas as decimal points for floating
+point numbers.  Slight tweaks to Makefile.PL to correctly install the POD.
 
 Major changes in 0.67 - 2006-08-08
 =====================================

Modified: packages/libversion-perl/branches/upstream/current/lib/version.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/lib/version.pm?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/lib/version.pm (original)
+++ packages/libversion-perl/branches/upstream/current/lib/version.pm Wed Dec 13 16:45:21 2006
@@ -6,7 +6,7 @@
 
 use vars qw(@ISA $VERSION $CLASS *qv);
 
-$VERSION = 0.6701;
+$VERSION = 0.68;
 
 $CLASS = 'version';
 

Modified: packages/libversion-perl/branches/upstream/current/t/01base.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/t/01base.t?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/t/01base.t (original)
+++ packages/libversion-perl/branches/upstream/current/t/01base.t Wed Dec 13 16:45:21 2006
@@ -7,7 +7,7 @@
 use Test::More qw/no_plan/;
 
 BEGIN {
-    use_ok("version", 0.58); # If we made it this far, we are ok.
+    use_ok("version", 0.6703); # If we made it this far, we are ok.
 }
 
 my $Verbose;

Modified: packages/libversion-perl/branches/upstream/current/t/02derived.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/t/02derived.t?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/t/02derived.t (original)
+++ packages/libversion-perl/branches/upstream/current/t/02derived.t Wed Dec 13 16:45:21 2006
@@ -7,7 +7,7 @@
 use Test::More qw/no_plan/;
 
 BEGIN {
-    use_ok("version", 0.58); # If we made it this far, we are ok.
+    use_ok("version", 0.6703); # If we made it this far, we are ok.
 }
 
 my $Verbose;

Modified: packages/libversion-perl/branches/upstream/current/t/coretests.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/t/coretests.pm?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/t/coretests.pm (original)
+++ packages/libversion-perl/branches/upstream/current/t/coretests.pm Wed Dec 13 16:45:21 2006
@@ -395,8 +395,10 @@
 	like ($@, qr/^www version 1.000 \(v1.0.0\) required/,
 	    "Comparing vs. version with decimal only"); 
 
-	skip 'Cannot "use" extended versions with Perl < 5.6.2', 1
-	    if $] < 5.006_002;
+	if ( $] < 5.006_002 ) {
+	    unlink 'www.pm';
+	    skip 'Cannot "use" extended versions with Perl < 5.6.2', 3; 
+	}
 	eval "use lib '.'; use www 0.0.8;";
 	like ($@, qr/^www version 0.000008 \(v0.0.8\) required/,
 	    "Make sure very small versions don't freak"); 
@@ -423,6 +425,198 @@
     ok(defined(&{"main\::qv"}), "make sure we exported qv() properly");
     isa_ok( qv(1.2), "vvv");
     unlink 'vvv.pm';
+
+SKIP: {
+	# test locale handling
+	my $ver = 1.23;  # has to be floating point number
+	my $loc;
+	while (<DATA>) {
+	    chomp;
+	    $loc = POSIX::setlocale( &POSIX::LC_ALL, $_);
+	    last if POSIX::localeconv()->{decimal_point} eq ',';
+	}
+	skip 'Cannot test locale handling without a comma locale', 4
+	    unless ( $loc and ($ver eq '1,23') );
+
+	diag ("Testing locale handling with $loc") if $Verbose;
+
+	my $v = $CLASS->new($ver);
+	unlike($warning,qr/Version string '1,23' contains invalid data/,
+	    "Process locale-dependent floating point");
+	is ($v, "1.230", "Locale doesn't apply to version objects");
+	ok ($v == $ver, "Comparison to locale floating point");
+    }
 }
 
 1;
+
+__DATA__
+af_ZA
+af_ZA.utf8
+an_ES
+an_ES.utf8
+az_AZ.utf8
+be_BY
+be_BY.utf8
+bg_BG
+bg_BG.utf8
+br_FR
+br_FR at euro
+br_FR.utf8
+bs_BA
+bs_BA.utf8
+ca_ES
+ca_ES at euro
+ca_ES.utf8
+cs_CZ
+cs_CZ.utf8
+da_DK
+da_DK.utf8
+de_AT
+de_AT at euro
+de_AT.utf8
+de_BE
+de_BE at euro
+de_BE.utf8
+de_DE
+de_DE at euro
+de_DE.utf8
+de_LU
+de_LU at euro
+de_LU.utf8
+el_GR
+el_GR.utf8
+en_DK
+en_DK.utf8
+es_AR
+es_AR.utf8
+es_BO
+es_BO.utf8
+es_CL
+es_CL.utf8
+es_CO
+es_CO.utf8
+es_EC
+es_EC.utf8
+es_ES
+es_ES at euro
+es_ES.utf8
+es_PY
+es_PY.utf8
+es_UY
+es_UY.utf8
+es_VE
+es_VE.utf8
+et_EE
+et_EE.iso885915
+et_EE.utf8
+eu_ES
+eu_ES at euro
+eu_ES.utf8
+fi_FI
+fi_FI at euro
+fi_FI.utf8
+fo_FO
+fo_FO.utf8
+fr_BE
+fr_BE at euro
+fr_BE.utf8
+fr_CA
+fr_CA.utf8
+fr_CH
+fr_CH.utf8
+fr_FR
+fr_FR at euro
+fr_FR.utf8
+fr_LU
+fr_LU at euro
+fr_LU.utf8
+gl_ES
+gl_ES at euro
+gl_ES.utf8
+hr_HR
+hr_HR.utf8
+hu_HU
+hu_HU.utf8
+id_ID
+id_ID.utf8
+is_IS
+is_IS.utf8
+it_CH
+it_CH.utf8
+it_IT
+it_IT at euro
+it_IT.utf8
+ka_GE
+ka_GE.utf8
+kk_KZ
+kk_KZ.utf8
+kl_GL
+kl_GL.utf8
+lt_LT
+lt_LT.utf8
+lv_LV
+lv_LV.utf8
+mk_MK
+mk_MK.utf8
+mn_MN
+mn_MN.utf8
+nb_NO
+nb_NO.utf8
+nl_BE
+nl_BE at euro
+nl_BE.utf8
+nl_NL
+nl_NL at euro
+nl_NL.utf8
+nn_NO
+nn_NO.utf8
+no_NO
+no_NO.utf8
+oc_FR
+oc_FR.utf8
+pl_PL
+pl_PL.utf8
+pt_BR
+pt_BR.utf8
+pt_PT
+pt_PT at euro
+pt_PT.utf8
+ro_RO
+ro_RO.utf8
+ru_RU
+ru_RU.koi8r
+ru_RU.utf8
+ru_UA
+ru_UA.utf8
+se_NO
+se_NO.utf8
+sh_YU
+sh_YU.utf8
+sk_SK
+sk_SK.utf8
+sl_SI
+sl_SI.utf8
+sq_AL
+sq_AL.utf8
+sr_CS
+sr_CS.utf8
+sv_FI
+sv_FI at euro
+sv_FI.utf8
+sv_SE
+sv_SE.iso885915
+sv_SE.utf8
+tg_TJ
+tg_TJ.utf8
+tr_TR
+tr_TR.utf8
+tt_RU.utf8
+uk_UA
+uk_UA.utf8
+vi_VN
+vi_VN.tcvn
+wa_BE
+wa_BE at euro
+wa_BE.utf8
+

Modified: packages/libversion-perl/branches/upstream/current/vperl/vpp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/vperl/vpp.pm?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/vperl/vpp.pm (original)
+++ packages/libversion-perl/branches/upstream/current/vperl/vpp.pm Wed Dec 13 16:45:21 2006
@@ -3,8 +3,9 @@
 use strict;
 
 use Scalar::Util;
+use locale;
 use vars qw ($VERSION @ISA @REGEXS);
-$VERSION = 0.6701;
+$VERSION = 0.68;
 
 push @REGEXS, qr/
 	^v?	# optional leading 'v'
@@ -23,6 +24,11 @@
 {
 	my ($class, $value) = @_;
 	my $self = bless ({}, ref ($class) || $class);
+	require POSIX;
+	my $currlocale = POSIX::setlocale(&POSIX::LC_ALL);
+	my $radix_comma = ( POSIX::localeconv()->{decimal_point} eq ',' );
+
+	POSIX::setlocale(&POSIX::LC_ALL, 'C') if $radix_comma;
 
 	if ( not defined $value or $value =~ /^undef$/ ) {
 	    # RT #19517 - special case for undef comparison
@@ -50,6 +56,11 @@
 	    $value =~ s/(0+)$//;
 	}
 	
+	# if the original locale used commas for decimal points, we
+	# need to force the PV to be regenerated, since just changing
+	# the locale isn't sufficient (use harmless math operation)
+	$value += 0 if $radix_comma;
+
 	# This is not very efficient, but it is morally equivalent
 	# to the XS code (as that is the reference implementation).
 	# See vutil/vutil.c for details
@@ -202,6 +213,8 @@
 	         "ignoring: '".substr($value,$pos)."'";
 	}
 
+	POSIX::setlocale(&POSIX::LC_ALL, $currlocale) if $radix_comma;
+
 	return ($self);
 }
 

Modified: packages/libversion-perl/branches/upstream/current/vutil/lib/version/vxs.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/vutil/lib/version/vxs.pm?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/vutil/lib/version/vxs.pm (original)
+++ packages/libversion-perl/branches/upstream/current/vutil/lib/version/vxs.pm Wed Dec 13 16:45:21 2006
@@ -9,7 +9,7 @@
 
 @ISA = qw(DynaLoader);
 
-$VERSION = 0.6701;
+$VERSION = 0.68;
 
 $CLASS = 'version::vxs';
 

Modified: packages/libversion-perl/branches/upstream/current/vutil/vutil.c
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/vutil/vutil.c?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/vutil/vutil.c (original)
+++ packages/libversion-perl/branches/upstream/current/vutil/vutil.c Wed Dec 13 16:45:21 2006
@@ -286,7 +286,13 @@
     if ( SvNOK(ver) ) /* may get too much accuracy */ 
     {
 	char tbuf[64];
-	STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
+#ifdef USE_LOCALE_NUMERIC
+	char *loc = setlocale(LC_NUMERIC, "C");
+#endif
+  	STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver));
+#ifdef USE_LOCALE_NUMERIC
+	setlocale(LC_NUMERIC, loc);
+#endif
 	while (tbuf[len-1] == '0' && len > 0) len--;
 	version = savepvn(tbuf, len);
     }

Modified: packages/libversion-perl/branches/upstream/current/vutil/vxs.xs
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libversion-perl/branches/upstream/current/vutil/vxs.xs?rev=4621&op=diff
==============================================================================
--- packages/libversion-perl/branches/upstream/current/vutil/vxs.xs (original)
+++ packages/libversion-perl/branches/upstream/current/vutil/vxs.xs Wed Dec 13 16:45:21 2006
@@ -2,6 +2,7 @@
 #include "perl.h"
 #include "XSUB.h"
 #define NEED_sv_2pv_nolen_GLOBAL
+#define NEED_my_snprintf
 #include "ppport.h"
 #include "vutil.h"
 
@@ -147,9 +148,14 @@
 	char *version;
 	if ( SvNOK(ver) ) /* may get too much accuracy */
 	{
-	    STRLEN len;
 	    char tbuf[64];
-	    len = sprintf(tbuf,"%.9"NVff, SvNVX(ver));
+#ifdef USE_LOCALE_NUMERIC
+	    char *loc = setlocale(LC_NUMERIC, "C");
+#endif
+	    STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVgf, SvNVX(ver));
+#ifdef USE_LOCALE_NUMERIC
+	    setlocale(LC_NUMERIC, loc);
+#endif
 	    while (tbuf[len-1] == '0' && len > 0) len--;
 	    version = savepvn(tbuf,len);
 	}




More information about the Pkg-perl-cvs-commits mailing list