Change 26685 by [EMAIL PROTECTED] on 2006/01/06 21:59:00

        Upgrade to version-0.52

Affected files ...

... //depot/perl/lib/version.pm#18 edit
... //depot/perl/lib/version.pod#4 edit
... //depot/perl/lib/version.t#15 edit
... //depot/perl/sv.c#1098 edit
... //depot/perl/t/op/sprintf.t#57 edit
... //depot/perl/util.c#529 edit

Differences ...

==== //depot/perl/lib/version.pm#18 (text) ====
Index: perl/lib/version.pm
--- perl/lib/version.pm#17~26246~       2005-12-02 19:30:00.000000000 -0800
+++ perl/lib/version.pm 2006-01-06 13:59:00.000000000 -0800
@@ -11,7 +11,7 @@
 
 @EXPORT = qw(qv);
 
-$VERSION = 0.50;
+$VERSION = 0.52;
 
 $CLASS = 'version';
 

==== //depot/perl/lib/version.pod#4 (text) ====
Index: perl/lib/version.pod
--- perl/lib/version.pod#3~26246~       2005-12-02 19:30:00.000000000 -0800
+++ perl/lib/version.pod        2006-01-06 13:59:00.000000000 -0800
@@ -55,13 +55,24 @@
 =item * Be careful
 
 If you are using Module::Build or ExtUtils::MakeMaker, so that you can
-release your module to CPAN, you have to recognize that none of those
-programs currently handles version objects natively (yet).  That also
-goes for the CPAN indexer (PAUSE).  Although there are modules on CPAN
-that employ the version module internally, the support for assigning a
-module $VERSION scalar is still lacking.  Both Module::Build and the 
-PAUSE indexer will [hopefully soon] include support for version 
-objects.
+release your module to CPAN, you have to recognize that neither of those
+programs completely handles version objects natively (yet).  If you use
+version objects with Module::Build, you should add an explicit dependency
+to the release of version.pm in your Build.PL:
+
+  my $builder = Module::Build->new(
+     ...
+     requires => {
+         ... ,
+         'version'    => 0.50,
+        ...,
+     },
+     ...
+  );
+
+and it should Just Work(TM).  Module::Build will [hopefully soon] 
+include full support for version objects; there are no current plans 
+to patch ExtUtils::MakeMaker to support version objects.
 
 =head2 What IS a version
 

==== //depot/perl/lib/version.t#15 (text) ====
Index: perl/lib/version.t
--- perl/lib/version.t#14~26246~        2005-12-02 19:30:00.000000000 -0800
+++ perl/lib/version.t  2006-01-06 13:59:00.000000000 -0800
@@ -4,7 +4,7 @@
 
 #########################
 
-use Test::More tests => 202;
+use Test::More qw(no_plan);
 
 diag "Tests with base class" unless $ENV{PERL_CORE};
 
@@ -94,6 +94,10 @@
        like($@, qr/underscores before decimal/,
            "Invalid version format (underscores before decimal)");
        
+       eval {my $version = $CLASS->new("1_2")};
+       like($@, qr/alpha without decimal/,
+           "Invalid version format (alpha without decimal)");
+
        $version = $CLASS->new("99 and 44/100 pure");
        ok ("$version" eq "99.000", '$version eq "99.000"');
        ok ($version->numify == 99.0, '$version->numify == 99.0');

==== //depot/perl/sv.c#1098 (text) ====
Index: perl/sv.c
--- perl/sv.c#1097~26675~       2006-01-06 07:50:34.000000000 -0800
+++ perl/sv.c   2006-01-06 13:59:00.000000000 -0800
@@ -8166,6 +8166,11 @@
                 */
                if (sv_derived_from(vecsv, "version")) {
                    char *version = savesvpv(vecsv);
+                   if ( hv_exists((HV*)SvRV(vecsv), "alpha", 5 ) ) {
+                       Perl_warner(aTHX_ packWARN(WARN_INTERNAL),
+                       "vector argument not supported with alpha versions");
+                       goto unknown;
+                   }
                    vecsv = sv_newmortal();
                    /* scan_vstring is expected to be called during
                     * tokenization, so we need to fake up the end

==== //depot/perl/t/op/sprintf.t#57 (xtext) ====
Index: perl/t/op/sprintf.t
--- perl/t/op/sprintf.t#56~26365~       2005-12-15 02:42:03.000000000 -0800
+++ perl/t/op/sprintf.t 2006-01-06 13:59:00.000000000 -0800
@@ -11,6 +11,7 @@
     @INC = '../lib';
 }
 use warnings;
+use version;
 use Config;
 use strict;
 
@@ -243,14 +244,11 @@
 >%vd<       >"\01\02\03"< >1.2.3<
 >%vd<       >v1.2.3<      >1.2.3<
 >%vd<       >[version::qv("1.2.3")]< >1.2.3<
->%vd<       >[version::qv("1.2")]< >1.2.0<
->%vd<       >[version::qv("1.02")]< >1.2.0<
->%vd<       >[version::qv("1.002")]< >1.2.0<
->%vd<       >[version::qv("1.02_03")]< >1.23<
->%vd<       >[version::qv("1048576.5")]< >1048576.5.0<
->%vd<       >[version::qv("50")]< >50.0.0<
->%vd<       >[version::qv("50_20")]< >50.200<
->%vd<       >[version::qv("5.005_03")]< >5.53<
+>%vd<       >[version->new("1.2")]< >1.200<
+>%vd<       >[version->new("1.02")]< >1.20<
+>%vd<       >[version->new("1.002")]< >1.2<
+>%vd<       >[version->new("1048576.5")]< >1048576.500<
+>%vd<       >[version->new("50")]< >50.0<
 >%v.3d<     >"\01\02\03"< >001.002.003<
 >%0v3d<     >"\01\02\03"< >001.002.003<
 >%v.3d<     >[version::qv("1.2.3")]< >001.002.003<

==== //depot/perl/util.c#529 (text) ====
Index: perl/util.c
--- perl/util.c#528~26675~      2006-01-06 07:50:34.000000000 -0800
+++ perl/util.c 2006-01-06 13:59:00.000000000 -0800
@@ -4031,6 +4031,9 @@
        pos++;
     }
 
+    if ( alpha && !saw_period )
+       Perl_croak(aTHX_ "Invalid version format (alpha without decimal)");
+
     if ( saw_period > 1 )
        qv = 1; /* force quoted version processing */
 
End of Patch.

Reply via email to