r2001 - in packages/libversion-perl/trunk: . debian lib lib/version t vutil

Krzysztof Krzyzaniak eloy at costa.debian.org
Thu Jan 19 09:46:11 UTC 2006


Author: eloy
Date: 2006-01-19 09:46:10 +0000 (Thu, 19 Jan 2006)
New Revision: 2001

Modified:
   packages/libversion-perl/trunk/Changes
   packages/libversion-perl/trunk/META.yml
   packages/libversion-perl/trunk/README
   packages/libversion-perl/trunk/debian/changelog
   packages/libversion-perl/trunk/lib/version.pm
   packages/libversion-perl/trunk/lib/version/vxs.pm
   packages/libversion-perl/trunk/t/coretests.pm
   packages/libversion-perl/trunk/vutil/vutil.c
Log:
eloy: new upstream version


Modified: packages/libversion-perl/trunk/Changes
===================================================================
--- packages/libversion-perl/trunk/Changes	2006-01-19 09:13:01 UTC (rev 2000)
+++ packages/libversion-perl/trunk/Changes	2006-01-19 09:46:10 UTC (rev 2001)
@@ -1,3 +1,21 @@
+2006-01-10  John Peacock <jpeacock at cpan.org>
+
+	Release 0.53 to CPAN.
+
+	* vutil/vutil.c
+	    warn() when initialization string contains trailing characters
+	    (rather than silently ignoring them).  Suggested by David Wheeler.
+
+	* t/coretests.pm
+	    Test the above change.
+
+	* README
+	    Document the above.
+
+	* lib/version.pm
+	  lib/version/vxs.pm
+	    Bump $VERSION.
+
 2006-01-06  John Peacock <jpeacock at cpan.org>
 
 	New version to deal with malformed input data that came up

Modified: packages/libversion-perl/trunk/META.yml
===================================================================
--- packages/libversion-perl/trunk/META.yml	2006-01-19 09:13:01 UTC (rev 2000)
+++ packages/libversion-perl/trunk/META.yml	2006-01-19 09:46:10 UTC (rev 2001)
@@ -1,6 +1,6 @@
 ---
 name: version
-version: 0.52
+version: 0.53
 author: ~
 abstract: ~
 license: perl
@@ -10,8 +10,8 @@
 provides:
   version:
     file: lib/version.pm
-    version: 0.52
+    version: 0.53
   version::vxs:
     file: lib/version/vxs.pm
-    version: 0.52
+    version: 0.53
 generated_by: Module::Build version 0.2611

Modified: packages/libversion-perl/trunk/README
===================================================================
--- packages/libversion-perl/trunk/README	2006-01-19 09:13:01 UTC (rev 2000)
+++ packages/libversion-perl/trunk/README	2006-01-19 09:46:10 UTC (rev 2001)
@@ -1,4 +1,4 @@
-version 0.52
+version 0.53
 ==================================
 
 Provides the same version objects as included in Perl v5.9.x (and hopefully in
@@ -9,6 +9,13 @@
 in the core).  If you are testing bleadperl, you will need to check out the
 latest release of 5.9.x to get the changes included in 0.50.
 
+Major changes in 0.53
+==================================
+The version parsing code always ignored trailing text that couldn't be
+parsed.  Now carp about it and show what was ignored.  Suggested by David
+Wheeler.
+
+
 Major changes in 0.52
 ==================================
 Check for malformed initializer ("1_2") based on discussion about

Modified: packages/libversion-perl/trunk/debian/changelog
===================================================================
--- packages/libversion-perl/trunk/debian/changelog	2006-01-19 09:13:01 UTC (rev 2000)
+++ packages/libversion-perl/trunk/debian/changelog	2006-01-19 09:46:10 UTC (rev 2001)
@@ -1,3 +1,9 @@
+libversion-perl (0.53-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org>  Thu, 19 Jan 2006 10:13:08 +0100
+
 libversion-perl (0.52-1) unstable; urgency=low
 
   * New upstream release

Modified: packages/libversion-perl/trunk/lib/version/vxs.pm
===================================================================
--- packages/libversion-perl/trunk/lib/version/vxs.pm	2006-01-19 09:13:01 UTC (rev 2000)
+++ packages/libversion-perl/trunk/lib/version/vxs.pm	2006-01-19 09:46:10 UTC (rev 2001)
@@ -12,7 +12,7 @@
 
 @EXPORT = qw(qv);
 
-$VERSION = 0.52;
+$VERSION = 0.53;
 
 $CLASS = 'version::vxs';
 

Modified: packages/libversion-perl/trunk/lib/version.pm
===================================================================
--- packages/libversion-perl/trunk/lib/version.pm	2006-01-19 09:13:01 UTC (rev 2000)
+++ packages/libversion-perl/trunk/lib/version.pm	2006-01-19 09:46:10 UTC (rev 2001)
@@ -11,7 +11,7 @@
 
 @EXPORT = qw(qv);
 
-$VERSION = 0.52;
+$VERSION = 0.53;
 
 $CLASS = 'version';
 

Modified: packages/libversion-perl/trunk/t/coretests.pm
===================================================================
--- packages/libversion-perl/trunk/t/coretests.pm	2006-01-19 09:13:01 UTC (rev 2000)
+++ packages/libversion-perl/trunk/t/coretests.pm	2006-01-19 09:46:10 UTC (rev 2001)
@@ -45,12 +45,31 @@
 	like($@, qr/alpha without decimal/,
 	    "Invalid version format (alpha without decimal)");
 	
+	# for this first test, just upgrade the warn() to die()
+	eval {
+	    local $SIG{__WARN__} = sub { die $_[0] };
+	    $version = $CLASS->new("1.2b3");
+	};
+	my $warnregex = "Version string '.+' contains invalid data; ".
+		"ignoring: '.+'";
+
+	like($@, qr/$warnregex/,
+	    "Version string contains invalid data; ignoring");
+
+        # from here on out capture the warning and test independently
+	my $warning;
+	local $SIG{__WARN__} = sub { $warning = $_[0] };
 	$version = $CLASS->new("99 and 44/100 pure");
+
+	like($warning, qr/$warnregex/,
+	    "Version string contains invalid data; ignoring");
 	ok ("$version" eq "99.000", '$version eq "99.000"');
 	ok ($version->numify == 99.0, '$version->numify == 99.0');
 	ok ($version->normal eq "v99.0.0", '$version->normal eq v99.0.0');
 	
 	$version = $CLASS->new("something");
+	like($warning, qr/$warnregex/,
+	    "Version string contains invalid data; ignoring");
 	ok (defined $version, 'defined $version');
 	
 	# reset the test object to something reasonable

Modified: packages/libversion-perl/trunk/vutil/vutil.c
===================================================================
--- packages/libversion-perl/trunk/vutil/vutil.c	2006-01-19 09:13:01 UTC (rev 2000)
+++ packages/libversion-perl/trunk/vutil/vutil.c	2006-01-19 09:46:10 UTC (rev 2001)
@@ -262,7 +262,7 @@
 SV *
 Perl_upg_version(pTHX_ SV *ver)
 {
-    char *version;
+    const char *version, *s;
     bool qv = 0;
 
     if ( SvNOK(ver) ) /* may get too much accuracy */ 
@@ -282,7 +282,10 @@
     {
 	version = savepv(SvPV_nolen(ver));
     }
-    (void)scan_version(version, ver, qv);
+    s = scan_version(version, ver, qv);
+    if ( *s != '\0' )
+	warn( "Version string '%s' contains invalid data; "
+	      "ignoring: '%s'", version, s);
     Safefree(version);
     return ver;
 }




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