[libconfig-any-perl] 01/01: Imported Upstream version 0.24

Salvatore Bonaccorso carnil at debian.org
Mon Sep 16 20:31:58 UTC 2013


This is an automated email from the git hooks/post-receive script.

carnil pushed a commit to annotated tag upstream/0.24
in repository libconfig-any-perl.

commit 4a7183c8631dac656337d640a064785a9c0ae40f
Author: Salvatore Bonaccorso <carnil at debian.org>
Date:   Mon Sep 16 22:03:01 2013 +0200

    Imported Upstream version 0.24
---
 Changes                        |    4 ++
 META.yml                       |    9 +++--
 inc/Module/Install.pm          |    6 +--
 inc/Module/Install/Base.pm     |    2 +-
 inc/Module/Install/Can.pm      |   85 +++++++++++++++++++++++++++++++++++++---
 inc/Module/Install/Fetch.pm    |    2 +-
 inc/Module/Install/Makefile.pm |   27 +++++++------
 inc/Module/Install/Metadata.pm |   22 +++++++----
 inc/Module/Install/Win32.pm    |    2 +-
 inc/Module/Install/WriteAll.pm |    2 +-
 lib/Config/Any.pm              |    2 +-
 lib/Config/Any/Base.pm         |    2 +-
 lib/Config/Any/General.pm      |    2 +-
 lib/Config/Any/INI.pm          |    2 +-
 lib/Config/Any/JSON.pm         |   10 ++++-
 lib/Config/Any/Perl.pm         |    2 +-
 lib/Config/Any/XML.pm          |    2 +-
 lib/Config/Any/YAML.pm         |    9 +----
 t/10-branches.t                |    1 -
 t/20-parse.t                   |    2 -
 t/55-yaml.t                    |    2 -
 t/62-multi.t                   |    2 -
 22 files changed, 139 insertions(+), 60 deletions(-)

diff --git a/Changes b/Changes
index 6f433d8..31d2a07 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Config-Any
 
+0.24 2013-09-10
+    - remove 4-year-old warning about YAML::XS not being installed
+    - add JSON::PP to list of available JSON parsers (RT #86959)
+
 0.23 2011-07-13
     - fix test suite's method of checking availability of plugins
 
diff --git a/META.yml b/META.yml
index 2e723dc..d82cf31 100644
--- a/META.yml
+++ b/META.yml
@@ -3,12 +3,13 @@ abstract: 'Load configuration from different file formats, transparently'
 author:
   - 'Joel Bernstein <rataxis at cpan.org>'
 build_requires:
-  ExtUtils::MakeMaker: 6.42
+  ExtUtils::MakeMaker: 6.59
   Test::More: 0
 configure_requires:
-  ExtUtils::MakeMaker: 6.42
+  ExtUtils::MakeMaker: 6.59
 distribution_type: module
-generated_by: 'Module::Install version 1.01'
+dynamic_config: 1
+generated_by: 'Module::Install version 1.06'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,4 +25,4 @@ requires:
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://git.shadowcat.co.uk/p5sagit/Config-Any.git
-version: 0.23
+version: 0.24
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 74caf9c..4ecf46b 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -31,7 +31,7 @@ BEGIN {
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '1.01';
+	$VERSION = '1.06';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -451,7 +451,7 @@ sub _version ($) {
 }
 
 sub _cmp ($$) {
-	_version($_[0]) <=> _version($_[1]);
+	_version($_[1]) <=> _version($_[2]);
 }
 
 # Cloned from Params::Util::_CLASS
@@ -467,4 +467,4 @@ sub _CLASS ($) {
 
 1;
 
-# Copyright 2008 - 2011 Adam Kennedy.
+# Copyright 2008 - 2012 Adam Kennedy.
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index d3662c9..802844a 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.01';
+	$VERSION = '1.06';
 }
 
 # Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 276409a..22167b8 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -3,13 +3,12 @@ package Module::Install::Can;
 
 use strict;
 use Config                ();
-use File::Spec            ();
 use ExtUtils::MakeMaker   ();
 use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.01';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -29,7 +28,7 @@ sub can_use {
 	eval { require $mod; $pkg->VERSION($ver || 0); 1 };
 }
 
-# check if we can run some command
+# Check if we can run some command
 sub can_run {
 	my ($self, $cmd) = @_;
 
@@ -38,14 +37,88 @@ sub can_run {
 
 	for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
 		next if $dir eq '';
-		my $abs = File::Spec->catfile($dir, $_[1]);
+		require File::Spec;
+		my $abs = File::Spec->catfile($dir, $cmd);
 		return $abs if (-x $abs or $abs = MM->maybe_command($abs));
 	}
 
 	return;
 }
 
-# can we locate a (the) C compiler
+# Can our C compiler environment build XS files
+sub can_xs {
+	my $self = shift;
+
+	# Ensure we have the CBuilder module
+	$self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
+
+	# Do we have the configure_requires checker?
+	local $@;
+	eval "require ExtUtils::CBuilder;";
+	if ( $@ ) {
+		# They don't obey configure_requires, so it is
+		# someone old and delicate. Try to avoid hurting
+		# them by falling back to an older simpler test.
+		return $self->can_cc();
+	}
+
+	# Do we have a working C compiler
+	my $builder = ExtUtils::CBuilder->new(
+		quiet => 1,
+	);
+	unless ( $builder->have_compiler ) {
+		# No working C compiler
+		return 0;
+	}
+
+	# Write a C file representative of what XS becomes
+	require File::Temp;
+	my ( $FH, $tmpfile ) = File::Temp::tempfile(
+		"compilexs-XXXXX",
+		SUFFIX => '.c',
+	);
+	binmode $FH;
+	print $FH <<'END_C';
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+int main(int argc, char **argv) {
+    return 0;
+}
+
+int boot_sanexs() {
+    return 1;
+}
+
+END_C
+	close $FH;
+
+	# Can the C compiler access the same headers XS does
+	my @libs   = ();
+	my $object = undef;
+	eval {
+		local $^W = 0;
+		$object = $builder->compile(
+			source => $tmpfile,
+		);
+		@libs = $builder->link(
+			objects     => $object,
+			module_name => 'sanexs',
+		);
+	};
+	my $result = $@ ? 0 : 1;
+
+	# Clean up all the build files
+	foreach ( $tmpfile, $object, @libs ) {
+		next unless defined $_;
+		1 while unlink;
+	}
+
+	return $result;
+}
+
+# Can we locate a (the) C compiler
 sub can_cc {
 	my $self   = shift;
 	my @chunks = split(/ /, $Config::Config{cc}) or return;
@@ -78,4 +151,4 @@ if ( $^O eq 'cygwin' ) {
 
 __END__
 
-#line 156
+#line 236
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 093cb7a..bee0c4f 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.01';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 4c71003..7052f36 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.01';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -215,18 +215,22 @@ sub write {
 	require ExtUtils::MakeMaker;
 
 	if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
-		# MakeMaker can complain about module versions that include
-		# an underscore, even though its own version may contain one!
-		# Hence the funny regexp to get rid of it.  See RT #35800
-		# for details.
-		my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
-		$self->build_requires(     'ExtUtils::MakeMaker' => $v );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
+		# This previous attempted to inherit the version of
+		# ExtUtils::MakeMaker in use by the module author, but this
+		# was found to be untenable as some authors build releases
+		# using future dev versions of EU:MM that nobody else has.
+		# Instead, #toolchain suggests we use 6.59 which is the most
+		# stable version on CPAN at time of writing and is, to quote
+		# ribasushi, "not terminally fucked, > and tested enough".
+		# TODO: We will now need to maintain this over time to push
+		# the version up as new versions are released.
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.59 );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
 	} else {
 		# Allow legacy-compatibility with 5.005 by depending on the
 		# most recent EU:MM that supported 5.005.
-		$self->build_requires(     'ExtUtils::MakeMaker' => 6.42 );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.36 );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
 	}
 
 	# Generate the MakeMaker params
@@ -241,7 +245,6 @@ in a module, and provide its file path via 'version_from' (or
 'all_from' if you prefer) in Makefile.PL.
 EOT
 
-	$DB::single = 1;
 	if ( $self->tests ) {
 		my @tests = split ' ', $self->tests;
 		my %seen;
@@ -412,4 +415,4 @@ sub postamble {
 
 __END__
 
-#line 541
+#line 544
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 3b01e09..58430f3 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.01';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -151,15 +151,21 @@ sub install_as_site   { $_[0]->installdirs('site')   }
 sub install_as_vendor { $_[0]->installdirs('vendor') }
 
 sub dynamic_config {
-	my $self = shift;
-	unless ( @_ ) {
-		warn "You MUST provide an explicit true/false value to dynamic_config\n";
-		return $self;
+	my $self  = shift;
+	my $value = @_ ? shift : 1;
+	if ( $self->{values}->{dynamic_config} ) {
+		# Once dynamic we never change to static, for safety
+		return 0;
 	}
-	$self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
+	$self->{values}->{dynamic_config} = $value ? 1 : 0;
 	return 1;
 }
 
+# Convenience command
+sub static_config {
+	shift->dynamic_config(0);
+}
+
 sub perl_version {
 	my $self = shift;
 	return $self->{values}->{perl_version} unless @_;
@@ -170,7 +176,7 @@ sub perl_version {
 	# Normalize the version
 	$version = $self->_perl_version($version);
 
-	# We don't support the reall old versions
+	# We don't support the really old versions
 	unless ( $version >= 5.005 ) {
 		die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
 	}
@@ -582,7 +588,7 @@ sub bugtracker_from {
 sub requires_from {
 	my $self     = shift;
 	my $content  = Module::Install::_readperl($_[0]);
-	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+	my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
 	while ( @requires ) {
 		my $module  = shift @requires;
 		my $version = shift @requires;
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 3139a63..eeaa3fe 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.01';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 1f724a7..85d8018 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.01';
+	$VERSION = '1.06';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
diff --git a/lib/Config/Any.pm b/lib/Config/Any.pm
index 4c614d7..c9f19cd 100644
--- a/lib/Config/Any.pm
+++ b/lib/Config/Any.pm
@@ -6,7 +6,7 @@ use warnings;
 use Carp;
 use Module::Pluggable::Object ();
 
-our $VERSION = '0.23';
+our $VERSION = '0.24';
 
 =head1 NAME
 
diff --git a/lib/Config/Any/Base.pm b/lib/Config/Any/Base.pm
index 65fe15f..9d4ebe3 100644
--- a/lib/Config/Any/Base.pm
+++ b/lib/Config/Any/Base.pm
@@ -18,7 +18,7 @@ format.
 =head2 is_supported( )
 
 Allows us to determine if the file format can be loaded. The can be done via
-one of two subclass methds:
+one of two subclass methods:
 
 =over 4
 
diff --git a/lib/Config/Any/General.pm b/lib/Config/Any/General.pm
index 38b03d3..3f0af30 100644
--- a/lib/Config/Any/General.pm
+++ b/lib/Config/Any/General.pm
@@ -76,7 +76,7 @@ Joel Bernstein E<lt>rataxis at cpan.orgE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2011 by Brian Cassidy
+Copyright 2006-2013 by Brian Cassidy
 
 Portions Copyright 2006 Portugal Telecom
 
diff --git a/lib/Config/Any/INI.pm b/lib/Config/Any/INI.pm
index 7dba15d..c6a8f60 100644
--- a/lib/Config/Any/INI.pm
+++ b/lib/Config/Any/INI.pm
@@ -103,7 +103,7 @@ Joel Bernstein E<lt>rataxis at cpan.orgE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2011 by Brian Cassidy, portions copyright 2006, 2007 by Joel Bernstein
+Copyright 2006-2013 by Brian Cassidy, portions copyright 2006, 2007 by Joel Bernstein
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 
diff --git a/lib/Config/Any/JSON.pm b/lib/Config/Any/JSON.pm
index ca2da3e..e8a1246 100644
--- a/lib/Config/Any/JSON.pm
+++ b/lib/Config/Any/JSON.pm
@@ -68,6 +68,12 @@ sub load {
         return JSON::Syck::Load( $content );
     }
 
+    eval { require JSON::PP; JSON::PP->VERSION( 2 ); };
+    unless( $@ ) {
+        my $decoder = JSON::PP->new->relaxed;
+        return $decoder->decode( $content );
+    }
+
     require JSON;
     eval { JSON->VERSION( 2 ); };
     return $@ ? JSON::jsonToObj( $content ) : JSON::from_json( $content );
@@ -80,7 +86,7 @@ L<JSON::Syck> or L<JSON> in order to work.
 
 =cut
 
-sub requires_any_of { 'JSON::DWIW', 'JSON::XS', 'JSON::Syck', 'JSON' }
+sub requires_any_of { 'JSON::DWIW', 'JSON::XS', 'JSON::Syck', 'JSON::PP', 'JSON' }
 
 =head1 AUTHOR
 
@@ -88,7 +94,7 @@ Brian Cassidy E<lt>bricas at cpan.orgE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2011 by Brian Cassidy
+Copyright 2006-2013 by Brian Cassidy
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 
diff --git a/lib/Config/Any/Perl.pm b/lib/Config/Any/Perl.pm
index 79cd322..6a5d7ad 100644
--- a/lib/Config/Any/Perl.pm
+++ b/lib/Config/Any/Perl.pm
@@ -62,7 +62,7 @@ Brian Cassidy E<lt>bricas at cpan.orgE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2011 by Brian Cassidy
+Copyright 2006-2013 by Brian Cassidy
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 
diff --git a/lib/Config/Any/XML.pm b/lib/Config/Any/XML.pm
index 844d76b..c068a1f 100644
--- a/lib/Config/Any/XML.pm
+++ b/lib/Config/Any/XML.pm
@@ -102,7 +102,7 @@ Joel Bernstein E<lt>rataxis at cpan.orgE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2011 by Brian Cassidy
+Copyright 2006-2013 by Brian Cassidy
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 
diff --git a/lib/Config/Any/YAML.pm b/lib/Config/Any/YAML.pm
index a12c74f..0281bb4 100644
--- a/lib/Config/Any/YAML.pm
+++ b/lib/Config/Any/YAML.pm
@@ -41,8 +41,6 @@ Attempts to load C<$file> as a YAML file.
 
 =cut
 
-our $NO_YAML_XS_WARNING;
-
 sub load {
     my $class = shift;
     my $file  = shift;
@@ -52,11 +50,6 @@ sub load {
         return YAML::XS::LoadFile( $file );
     }
 
-    Carp::carp
-        'Use of YAML::Syck or YAML to parse config files is DEPRECATED. '
-        . 'Please install YAML::XS for proper YAML support'
-            unless $NO_YAML_XS_WARNING;
-
     eval { require YAML::Syck; YAML::Syck->VERSION( '0.70' ) };
     unless ( $@ ) {
         open( my $fh, $file ) or die $!;
@@ -84,7 +77,7 @@ Brian Cassidy E<lt>bricas at cpan.orgE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2006-2011 by Brian Cassidy
+Copyright 2006-2013 by Brian Cassidy
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 
diff --git a/t/10-branches.t b/t/10-branches.t
index 96d4cab..40df34b 100644
--- a/t/10-branches.t
+++ b/t/10-branches.t
@@ -8,7 +8,6 @@ use Test::More tests => 11;
 use_ok( 'Config::Any' );
 use_ok( 'Config::Any::YAML' );
 
-$Config::Any::YAML::NO_YAML_XS_WARNING = 1;
 
 {
     my @warnings;
diff --git a/t/20-parse.t b/t/20-parse.t
index 7396003..bd834ba 100644
--- a/t/20-parse.t
+++ b/t/20-parse.t
@@ -14,8 +14,6 @@ use Config::Any::Perl;
 use Config::Any::XML;
 use Config::Any::YAML;
 
-$Config::Any::YAML::NO_YAML_XS_WARNING = 1;
-
 our %ext_map = (
     conf => 'Config::Any::General',
     ini  => 'Config::Any::INI',
diff --git a/t/55-yaml.t b/t/55-yaml.t
index caf6f66..7b7b5bc 100644
--- a/t/55-yaml.t
+++ b/t/55-yaml.t
@@ -5,8 +5,6 @@ no warnings 'once';
 use Test::More;
 use Config::Any::YAML;
 
-$Config::Any::YAML::NO_YAML_XS_WARNING = 1;
-
 if ( !Config::Any::YAML->is_supported ) {
     plan skip_all => 'YAML format not supported';
 }
diff --git a/t/62-multi.t b/t/62-multi.t
index 7ac9f8c..90369bf 100644
--- a/t/62-multi.t
+++ b/t/62-multi.t
@@ -7,8 +7,6 @@ use Test::More tests => 3;
 use Config::Any;
 use Config::Any::YAML;
 
-$Config::Any::YAML::NO_YAML_XS_WARNING = 1;
-
 my $file   = 't/multi/conf.yml';
 my @expect = (
     {   name  => 'TestApp',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-any-perl.git



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