r62133 - in /branches/upstream/libjson-perl/current: Changes META.yml Makefile.PL README lib/JSON.pm lib/JSON/PP.pm t/11_pc_expo.t
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Sat Aug 28 14:18:59 UTC 2010
Author: gregoa
Date: Sat Aug 28 14:18:53 2010
New Revision: 62133
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62133
Log:
[svn-upgrade] new version libjson-perl (2.22)
Modified:
branches/upstream/libjson-perl/current/Changes
branches/upstream/libjson-perl/current/META.yml
branches/upstream/libjson-perl/current/Makefile.PL
branches/upstream/libjson-perl/current/README
branches/upstream/libjson-perl/current/lib/JSON.pm
branches/upstream/libjson-perl/current/lib/JSON/PP.pm
branches/upstream/libjson-perl/current/t/11_pc_expo.t
Modified: branches/upstream/libjson-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-perl/current/Changes?rev=62133&op=diff
==============================================================================
--- branches/upstream/libjson-perl/current/Changes (original)
+++ branches/upstream/libjson-perl/current/Changes Sat Aug 28 14:18:53 2010
@@ -15,6 +15,15 @@
!! Since 2.16, PP's relaxed option caused an infinite loop in some condition.
!! Recommend to update old versions.
+
+2.22 Wed Aug 25 12:46:13 2010
+ [JSON]
+ - added JSON::XS installing feature in Makefile.PL
+ with cpan or cpanm (some points suggested by gfx)
+ - check that to_json and from_json are not called as methods (CHORNY)
+ [JSON::PP]
+ - modified for -Duse64bitall -Duselongdouble compiled perl.
+ 11_pc_expo.t too. (these are patched by H.Merijn Brand)
2.21 Mon Apr 5 14:56:52 2010
[JSON]
Modified: branches/upstream/libjson-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-perl/current/META.yml?rev=62133&op=diff
==============================================================================
--- branches/upstream/libjson-perl/current/META.yml (original)
+++ branches/upstream/libjson-perl/current/META.yml Sat Aug 28 14:18:53 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: JSON
-version: 2.21
+version: 2.22
abstract: JSON (JavaScript Object Notation) encoder/decoder
author:
- Makamaka Hannyaharamitu, E<lt>makamaka[at]cpan.orgE<gt>
@@ -18,7 +18,7 @@
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.54
+generated_by: ExtUtils::MakeMaker version 6.56
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
Modified: branches/upstream/libjson-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-perl/current/Makefile.PL?rev=62133&op=diff
==============================================================================
--- branches/upstream/libjson-perl/current/Makefile.PL (original)
+++ branches/upstream/libjson-perl/current/Makefile.PL Sat Aug 28 14:18:53 2010
@@ -3,6 +3,8 @@
use ExtUtils::MakeMaker;
use lib qw( ./lib );
+
+$| = 1;
eval q| require JSON |;
@@ -21,6 +23,7 @@
my $version = JSON->VERSION;
my $req_xs_ver = JSON->require_xs_version;
my $has_xs = 0;
+my $xs_ver_is_ok;
my $message;
eval q| require JSON::XS |;
@@ -32,6 +35,7 @@
my $xs_version = JSON::XS->VERSION;
if ($xs_version >= $req_xs_ver) {
$message = "You have JSON::XS (v.$xs_version), so JSON can work very fast!!";
+ $xs_ver_is_ok++;
}
else {
$message = "Your JSON::XS version is $xs_version, but if you install v.$req_xs_ver,\n"
@@ -56,13 +60,28 @@
EOF
-sleep 3;
+
+sleep 2;
+
+my @prereq_pm;
+
+if ( can_auto_xs_install() and not $xs_ver_is_ok ) {
+
+ my $prompt = prompt("Do you want to install JSON::XS?(Y/n)", 'Y');
+
+ if ( $prompt =~ /^[yY]/ ) {
+ @prereq_pm = ( 'JSON::XS' => $req_xs_ver );
+ }
+
+}
+
WriteMakefile(
'NAME' => 'JSON',
'VERSION_FROM' => 'lib/JSON.pm', # finds $VERSION
'PREREQ_PM' => {
'Test::More' => 0,
+ @prereq_pm,
},
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/JSON.pm', # retrieve abstract from module
@@ -91,3 +110,35 @@
rename("Makefile.tmp" => "Makefile");
}
+
+
+
+sub can_auto_xs_install {
+ return 0 if $] < 5.008002; # JSON::XS requires
+ return 0 unless ( $ENV{PERL5_CPAN_IS_RUNNING} or $ENV{PERL5_CPANM_IS_RUNNING} ); # not cpan/cpanm running
+ return can_cc();
+}
+
+
+# copied from http://cpansearch.perl.org/src/GBARR/Scalar-List-Utils-1.23/Makefile.PL
+
+use Config;
+
+
+sub can_cc {
+
+ require File::Spec;
+
+ foreach my $cmd (split(/ /, $Config::Config{cc})) {
+ my $_cmd = $cmd;
+
+ return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
+
+ for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ my $abs = File::Spec->catfile($dir, $_[1]);
+ return $abs if (-x $abs or $abs = MM->maybe_command($abs));
+ }
+ }
+
+ return;
+}
Modified: branches/upstream/libjson-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-perl/current/README?rev=62133&op=diff
==============================================================================
--- branches/upstream/libjson-perl/current/README (original)
+++ branches/upstream/libjson-perl/current/README Sat Aug 28 14:18:53 2010
@@ -45,7 +45,7 @@
# recommend to use (en|de)code_json.
VERSION
- 2.21
+ 2.22
This version is compatible with JSON::XS 2.27 and later.
Modified: branches/upstream/libjson-perl/current/lib/JSON.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-perl/current/lib/JSON.pm?rev=62133&op=diff
==============================================================================
--- branches/upstream/libjson-perl/current/lib/JSON.pm (original)
+++ branches/upstream/libjson-perl/current/lib/JSON.pm Sat Aug 28 14:18:53 2010
@@ -7,7 +7,7 @@
@JSON::EXPORT = qw(from_json to_json jsonToObj objToJson encode_json decode_json);
BEGIN {
- $JSON::VERSION = '2.21';
+ $JSON::VERSION = '2.22';
$JSON::DEBUG = 0 unless (defined $JSON::DEBUG);
}
@@ -128,6 +128,9 @@
# INTERFACES
sub to_json ($@) {
+ if ( ref($_[0]) eq 'JSON' or $_[0] eq 'JSON' ) {
+ Carp::croak "to_json should not be called as a method.";
+ }
my $json = new JSON;
if (@_ == 2 and ref $_[1] eq 'HASH') {
@@ -142,6 +145,9 @@
sub from_json ($@) {
+ if ( ref($_[0]) eq 'JSON' or $_[0] eq 'JSON' ) {
+ Carp::croak "from_json should not be called as a method.";
+ }
my $json = new JSON;
if (@_ == 2 and ref $_[1] eq 'HASH') {
@@ -608,7 +614,7 @@
=head1 VERSION
- 2.21
+ 2.22
This version is compatible with JSON::XS B<2.27> and later.
Modified: branches/upstream/libjson-perl/current/lib/JSON/PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-perl/current/lib/JSON/PP.pm?rev=62133&op=diff
==============================================================================
--- branches/upstream/libjson-perl/current/lib/JSON/PP.pm (original)
+++ branches/upstream/libjson-perl/current/lib/JSON/PP.pm Sat Aug 28 14:18:53 2010
@@ -11,7 +11,7 @@
use B ();
#use Devel::Peek;
-$JSON::PP::VERSION = '2.27003';
+$JSON::PP::VERSION = '2.27004';
@JSON::PP::EXPORT = qw(encode_json decode_json from_json to_json);
@@ -613,7 +613,7 @@
BEGIN {
my $checkint = 1111;
- for my $d (5..30) {
+ for my $d (5..64) {
$checkint .= 1;
my $int = eval qq| $checkint |;
if ($int =~ /[eE]/) {
Modified: branches/upstream/libjson-perl/current/t/11_pc_expo.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libjson-perl/current/t/11_pc_expo.t?rev=62133&op=diff
==============================================================================
--- branches/upstream/libjson-perl/current/t/11_pc_expo.t (original)
+++ branches/upstream/libjson-perl/current/t/11_pc_expo.t Sat Aug 28 14:18:53 2010
@@ -39,9 +39,9 @@
-$js = q|[1.01e+30]|;
+$js = q|[1.01e+67]|; # 30 -> 67 ... patched by H.Merijn Brand
$obj = $pc->decode($js);
-is($obj->[0], 1.01e+30, 'digit 1.01e+30');
+is($obj->[0], 1.01e+67, 'digit 1.01e+67');
$js = $pc->encode($obj);
-like($js,qr/\[1.01[Ee]\+0?30\]/, 'digit 1.01e+30');
+like($js,qr/\[1.01[Ee]\+0?67\]/, 'digit 1.01e+67');
More information about the Pkg-perl-cvs-commits
mailing list