r50474 - in /trunk/libjson-perl: Changes MANIFEST META.yml README debian/changelog debian/copyright lib/JSON.pm lib/JSON/PP.pm t/22_comment_at_eof.t

angelabad-guest at users.alioth.debian.org angelabad-guest at users.alioth.debian.org
Thu Jan 7 16:59:50 UTC 2010


Author: angelabad-guest
Date: Thu Jan  7 16:59:42 2010
New Revision: 50474

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50474
Log:
New upstream release 2.17

Added:
    trunk/libjson-perl/t/22_comment_at_eof.t
      - copied unchanged from r50469, branches/upstream/libjson-perl/current/t/22_comment_at_eof.t
Modified:
    trunk/libjson-perl/Changes
    trunk/libjson-perl/MANIFEST
    trunk/libjson-perl/META.yml
    trunk/libjson-perl/README
    trunk/libjson-perl/debian/changelog
    trunk/libjson-perl/debian/copyright
    trunk/libjson-perl/lib/JSON.pm
    trunk/libjson-perl/lib/JSON/PP.pm

Modified: trunk/libjson-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/Changes?rev=50474&op=diff
==============================================================================
--- trunk/libjson-perl/Changes (original)
+++ trunk/libjson-perl/Changes Thu Jan  7 16:59:42 2010
@@ -12,6 +12,18 @@
      Please check JSON::RPC (supports JSON-RPC protocol v1.1 and 1.0).
 
 ##########################################################################
+
+ !! Since 2.16, PP's relaxed option caused an infinite loop in some condition.
+ !! Recommend to update old versions.
+
+2.17  Thu Jan  7 12:23:13 2010
+	[JSON]
+	- fixed a problem caused by JSON::XS backend and support_by_pp option
+	  (rt#52842,  rt#52847 by ikegami)
+	[JSON::PP]
+	- made compatible with JSON::XS 2.27
+	- patched decode for incr_parse (rt#52820 by ikegami)
+	- relaxed option caused an infinite loop in some condition.
 
 2.16  Fri Oct 16 15:07:37 2009
 	[JSON][JSON::PP]

Modified: trunk/libjson-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/MANIFEST?rev=50474&op=diff
==============================================================================
--- trunk/libjson-perl/MANIFEST (original)
+++ trunk/libjson-perl/MANIFEST Thu Jan  7 16:59:42 2010
@@ -31,6 +31,7 @@
 t/19_incr.t
 t/20_unknown.t
 t/21_evans_bugrep.t
+t/22_comment_at_eof.t
 t/99_binary.t
 
 t/e00_func.t

Modified: trunk/libjson-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/META.yml?rev=50474&op=diff
==============================================================================
--- trunk/libjson-perl/META.yml (original)
+++ trunk/libjson-perl/META.yml Thu Jan  7 16:59:42 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               JSON
-version:            2.16
+version:            2.17
 abstract:           JSON (JavaScript Object Notation) encoder/decoder
 author:
     - Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>

Modified: trunk/libjson-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/README?rev=50474&op=diff
==============================================================================
--- trunk/libjson-perl/README (original)
+++ trunk/libjson-perl/README Thu Jan  7 16:59:42 2010
@@ -1,4 +1,4 @@
-JSON version 2.16
+JSON version 2.17
 =================
 
 INSTALLATION
@@ -42,9 +42,9 @@
      use JSON -support_by_pp;
 
 VERSION
-        2.16
-
-    This version is compatible with JSON::XS 2.26 and later.
+        2.17
+
+    This version is compatible with JSON::XS 2.27 and later.
 
 DESCRIPTION
      ************************** CAUTION ********************************

Modified: trunk/libjson-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/debian/changelog?rev=50474&op=diff
==============================================================================
--- trunk/libjson-perl/debian/changelog (original)
+++ trunk/libjson-perl/debian/changelog Thu Jan  7 16:59:42 2010
@@ -1,3 +1,10 @@
+libjson-perl (2.17-1) unstable; urgency=low
+
+  * New upstream release
+  * Update copyright file
+
+ -- Angel Abad <angelabad at gmail.com>  Thu, 07 Jan 2010 17:59:21 +0100
+
 libjson-perl (2.16-1) unstable; urgency=low
 
   [ Nathan Handler ]

Modified: trunk/libjson-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/debian/copyright?rev=50474&op=diff
==============================================================================
--- trunk/libjson-perl/debian/copyright (original)
+++ trunk/libjson-perl/debian/copyright Thu Jan  7 16:59:42 2010
@@ -1,32 +1,33 @@
-Format-Specification:
-    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
-Upstream-Maintainer: Makamaka Hannyaharamitu, <makamaka at cpan.org>
-Upstream-Source: http://search.cpan.org/dist/JSON/
-Upstream-Name: JSON
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: Makamaka Hannyaharamitu <makamaka at cpan.org>
+Source: http://search.cpan.org/dist/JSON/
+Name: JSON
 
 Files: *
-Copyright: 2005-2009, Makamaka Hannyaharamitu <makamaka at cpan.org>
+Copyright: 2005-20010, Makamaka Hannyaharamitu <makamaka at cpan.org>
 License-Alias: Perl
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
 
 Files: debian/*
 Copyright: 2005, 2007, 2008, Ivan Kohler <ivan-debian at 420.am>
  2008, 2009, Angel Abad (Ikusnet SLL) <angel at grupoikusnet.com>
- 2009, Angel Abad <angelabad at gmail.com>
+ 2009, 2010, Angel Abad <angelabad at gmail.com>
  2009, Ansgar Burchardt <ansgar at 43-1.org>
  2009, Nathan Handler <nhandler at ubuntu.com>
-License: Artistic | GPL-1+
+License: Artistic or GPL-1+
 
 License: Artistic
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the Artistic License, which comes with Perl.
-    On Debian GNU/Linux systems, the complete text of the Artistic License
-    can be found in `/usr/share/common-licenses/Artistic'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the Artistic License, which comes with Perl.
+ .
+ On Debian GNU/Linux systems, the complete text of the Artistic License
+ can be found in `/usr/share/common-licenses/Artistic'
 
 License: GPL-1+
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 1, or (at your option)
-    any later version.
-    On Debian GNU/Linux systems, the complete text of the GNU General
-    Public License can be found in `/usr/share/common-licenses/GPL'
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+ .
+ On Debian GNU/Linux systems, the complete text of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL'

Modified: trunk/libjson-perl/lib/JSON.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/lib/JSON.pm?rev=50474&op=diff
==============================================================================
--- trunk/libjson-perl/lib/JSON.pm (original)
+++ trunk/libjson-perl/lib/JSON.pm Thu Jan  7 16:59:42 2010
@@ -7,13 +7,13 @@
 @JSON::EXPORT = qw(from_json to_json jsonToObj objToJson encode_json decode_json);
 
 BEGIN {
-    $JSON::VERSION = '2.16';
+    $JSON::VERSION = '2.17';
     $JSON::DEBUG   = 0 unless (defined $JSON::DEBUG);
 }
 
 my $Module_XS  = 'JSON::XS';
 my $Module_PP  = 'JSON::PP';
-my $XS_Version = '2.26';
+my $XS_Version = '2.27';
 
 
 # XS and PP common methods
@@ -414,6 +414,7 @@
         bless  $proto, $pkg;
     };
 
+
     for my $method (@methods) {
         my $flag = uc($method);
         my $type |= (UNSUPPORTED_ENCODE_FLAG->{$flag} || 0);
@@ -441,9 +442,20 @@
 
 package JSON::Backend::XS::Supportable;
 
-
-my $JSON_XS_encode_orignal = \&JSON::XS::encode;
-my $JSON_XS_decode_orignal = \&JSON::XS::decode;
+{
+    my $JSON_XS_encode_orignal = \&JSON::XS::encode;
+    my $JSON_XS_decode_orignal = \&JSON::XS::decode;
+    my $JSON_XS_incr_parse_orignal = \&JSON::XS::incr_parse;
+
+    local $^W;
+    *JSON::XS::decode = \&JSON::Backend::XS::Supportable::_decode;
+    *JSON::XS::encode = \&JSON::Backend::XS::Supportable::_encode;
+    *JSON::XS::incr_parse = \&JSON::Backend::XS::Supportable::_incr_parse;
+
+    *{JSON::XS::_original_decode} = $JSON_XS_decode_orignal;
+    *{JSON::XS::_original_encode} = $JSON_XS_encode_orignal;
+    *{JSON::XS::_original_incr_parse} = $JSON_XS_incr_parse_orignal;
+}
 
 $Carp::Internal{'JSON::Backend::XS::Supportable'} = 1;
 
@@ -461,16 +473,6 @@
         else {
             ${$_[0]} &= ~$type;
         }
-
-        if (${$_[0]}) {
-            *JSON::XS::encode = \&JSON::Backend::XS::Supportable::_encode;
-            *JSON::XS::decode = \&JSON::Backend::XS::Supportable::_decode;
-        }
-        else {
-            *JSON::XS::encode = $JSON_XS_encode_orignal;
-            *JSON::XS::decode = $JSON_XS_decode_orignal;
-        }
-
         $_[0];
     };
 
@@ -507,19 +509,38 @@
     return $pp;
 }
 
-
 sub _encode { # using with PP encod
-    _set_for_pp('encode' => @_)->encode($_[1]);
+    if (${$_[0]}) {
+        _set_for_pp('encode' => @_)->encode($_[1]);
+    }
+    else {
+        $_[0]->_original_encode( $_[1] );
+    }
 }
 
 
 sub _decode { # if unsupported-flag is set, use PP
-    _set_for_pp('decode' => @_)->decode($_[1]);
+    if (${$_[0]}) {
+        _set_for_pp('decode' => @_)->decode($_[1]);
+    }
+    else {
+        $_[0]->_original_decode( $_[1] );
+    }
 }
 
 
 sub decode_prefix { # if unsupported-flag is set, use PP
     _set_for_pp('decode' => @_)->decode_prefix($_[1]);
+}
+
+
+sub _incr_parse {
+    if (${$_[0]}) {
+        _set_for_pp('decode' => @_)->incr_parse($_[1]);
+    }
+    else {
+        $_[0]->_original_incr_parse( $_[1] );
+    }
 }
 
 
@@ -586,9 +607,9 @@
 
 =head1 VERSION
 
-    2.16
-
-This version is compatible with JSON::XS B<2.26> and later.
+    2.17
+
+This version is compatible with JSON::XS B<2.27> and later.
 
 
 =head1 DESCRIPTION
@@ -2058,7 +2079,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2005-2009 by Makamaka Hannyaharamitu
+Copyright 2005-2010 by Makamaka Hannyaharamitu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 

Modified: trunk/libjson-perl/lib/JSON/PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-perl/lib/JSON/PP.pm?rev=50474&op=diff
==============================================================================
--- trunk/libjson-perl/lib/JSON/PP.pm (original)
+++ trunk/libjson-perl/lib/JSON/PP.pm Thu Jan  7 16:59:42 2010
@@ -11,7 +11,7 @@
 use B ();
 #use Devel::Peek;
 
-$JSON::PP::VERSION = '2.26000';
+$JSON::PP::VERSION = '2.27000';
 
 @JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json);
 
@@ -707,7 +707,13 @@
                     : (!$octets[2]                ) ? 'UTF-32LE'
                     : 'unknown';
 
-        my $result = value();
+#        my $result = value();
+
+        my $eof = !( my ( $result ) = value() ); # $eof for incr_parse
+
+        if ( $eof && ( $opt & 0x00000001 ) ) {
+            return undef;
+        }
 
         if (!$idx->[ P_ALLOW_NONREF ] and !ref $result) {
                 decode_error(
@@ -891,7 +897,7 @@
             else{
                 if ($relaxed and $ch eq '#') { # correctly?
                     pos($text) = $at;
-                    $text =~ /\G([^\n]*(?:\r\n|\r|\n))/g;
+                    $text =~ /\G([^\n]*(?:\r\n|\r|\n|$))/g;
                     $at = pos($text);
                     next_chr;
                     next;
@@ -1227,9 +1233,6 @@
             $no_rep ? "$error" : "$error, at character offset $at (before \"$mess\")"
         );
 
-#        Carp::croak (
-#            $no_rep ? "$error" : "$error, at character offset $at [\"$mess\"]"
-#        );
     }
 
 
@@ -1341,6 +1344,8 @@
 use constant INCR_M_STR  => 1; # inside string
 use constant INCR_M_BS   => 2; # inside backslash
 use constant INCR_M_JSON => 3; # outside anything, count nesting
+use constant INCR_M_C0   => 4;
+use constant INCR_M_C1   => 5;
 
 $JSON::PP::IncrParser::VERSION = '1.01';
 
@@ -1450,6 +1455,12 @@
             elsif ( $s eq ']' or $s eq '}' ) {
                 last if ( --$self->{incr_nest} <= 0 );
             }
+            elsif ( $s eq '#' ) {
+                while ( $len > $p ) {
+                    last if substr( $text, $p++, 1 ) eq "\n";
+                }
+            }
+
         }
 
     }
@@ -2125,7 +2136,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2007-2009 by Makamaka Hannyaharamitu
+Copyright 2007-2010 by Makamaka Hannyaharamitu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 




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