[libconfig-tiny-perl] 06/21: new upstream release

Damyan Ivanov dmn at moszumanska.debian.org
Sat Jun 20 11:30:30 UTC 2015


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

dmn pushed a commit to branch master
in repository libconfig-tiny-perl.

commit df754576f67ce2666481c25ecce648edc3951df8
Author: Dominic Hargreaves <dom at earth.li>
Date:   Sat Feb 5 12:26:43 2011 +0000

    new upstream release
---
 Changes            | 10 ++++++--
 MANIFEST           |  5 ++--
 META.yml           | 32 +++++++++++++++++---------
 Makefile.PL        | 46 ++++++++++++++++++++++++++++---------
 README             | 23 ++++++++++---------
 debian/changelog   |  6 ++---
 lib/Config/Tiny.pm | 38 ++++++++++++++++++++-----------
 t/02_main.t        |  2 +-
 t/98_pod.t         | 67 ------------------------------------------------------
 t/99_pmv.t         | 22 ------------------
 xt/meta.t          | 27 ++++++++++++++++++++++
 xt/pmv.t           | 32 ++++++++++++++++++++++++++
 xt/pod.t           | 32 ++++++++++++++++++++++++++
 13 files changed, 199 insertions(+), 143 deletions(-)

diff --git a/Changes b/Changes
index 22af10b..8b7b91e 100755
--- a/Changes
+++ b/Changes
@@ -1,4 +1,10 @@
-Revision history for Perl extension Config::Tiny
+Revision history for Perl extension Config-Tiny
+
+2.13 Fri  3 Sep 2010
+	- Resolved #60703: Display glitch in Config::Tiny 2.12 POD
+	- Resolved #40585: member 'set;' doesn't exist
+	- Resolved #30479: does not warn or die when writing data it
+	  cannot later.
 
 2.12 Thu  1 Nov 2007
 	- Converting build script from Module::Install to tinier EU:MM
@@ -75,7 +81,7 @@ Revision history for Perl extension Config::Tiny
 1.5  Wed Jan  7 2004
 	- Updating documentation to provide a correct location to send bug reports
 
-1.4  Web Dec 24 2003
+1.4  Wed Dec 24 2003
 	- Caught a warning when trying to parse an undefined string.
 	  Returns undef in that case.
 	- Merry Christmas and a productive New Year to you all!
diff --git a/MANIFEST b/MANIFEST
index d5cc24c..3b04dfd 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -6,7 +6,8 @@ MANIFEST			This list of files
 README
 t/01_compile.t
 t/02_main.t
-t/98_pod.t
-t/99_pmv.t
 test.conf
+xt/meta.t
+xt/pmv.t
+xt/pod.t
 META.yml                                 Module meta-data (added by MakeMaker)
diff --git a/META.yml b/META.yml
index 41e7fb6..9fc5284 100644
--- a/META.yml
+++ b/META.yml
@@ -1,14 +1,24 @@
 --- #YAML:1.0
-name:                Config-Tiny
-version:             2.12
-abstract:            Read/Write .ini style files with as little code as possible
-license:             perl
-generated_by:        ExtUtils::MakeMaker version 6.32
-distribution_type:   module
-requires:     
-    Test::More:                    0.47
-meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
-    version: 1.2
+name:               Config-Tiny
+version:            2.13
+abstract:           Read/Write .ini style files with as little code as possible
 author:
     - Adam Kennedy <adamk at cpan.org>
+license:            perl
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+build_requires:
+    Test::More:  0.47
+requires:
+    perl:  5.004
+resources:
+    repository:  http://svn.ali.as/cpan/trunk/Config-Tiny
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.56
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4
diff --git a/Makefile.PL b/Makefile.PL
index 328e176..5206d5c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,21 +2,45 @@ use strict;
 use vars qw{$VERSION};
 BEGIN {
 	require 5.003_96;
-	$VERSION = '2.12';
+	$VERSION = '2.13';
 }
 use ExtUtils::MakeMaker;
 
-WriteMakefile(
+WriteMakefile1(
+	MIN_PERL_VERSION => '5.004', #from Tiny.pm
+	META_MERGE => {
+		resources => {
+			repository => 'http://svn.ali.as/cpan/trunk/Config-Tiny',
+		},
+	},
+	BUILD_REQUIRES => {
+		# Skip on Windows to avoid breaking ActivePerl PPMs
+		# 0.47 means 5.6.2 or newer, which everyone on Win32 has.
+		($^O eq 'MSWin32' ? () : ('Test::More' => '0.47')),
+	},
 	NAME      => 'Config::Tiny',
 	ABSTRACT  => 'Read/Write .ini style files with as little code as possible',
 	VERSION   => $VERSION,
-	PREREQ_PM => {
-		'Test::More' => '0.47',
-	},
-	($] >= 5.005 ? (
-		AUTHOR  => 'Adam Kennedy <adamk at cpan.org>',
-	) : ()),
-	($ExtUtils::MakeMaker::VERSION ge '6.30_00' ? (
-		LICENSE => 'perl',
-	) : ()),
+	PREREQ_PM => { },
+	AUTHOR    => 'Adam Kennedy <adamk at cpan.org>',
+	LICENSE   => 'perl',
 );
+
+# Written by Alexandr Ciornii, version 0.20. Added by eumm-upgrade.
+sub WriteMakefile1 {
+	my %params = @_;
+	my $eumm_version = $ExtUtils::MakeMaker::VERSION;
+	$eumm_version = eval $eumm_version;
+	die "License not specified" if not exists $params{LICENSE};
+	if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) {
+		#EUMM 6.5502 has problems with BUILD_REQUIRES
+		$params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{BUILD_REQUIRES}} };
+		delete $params{BUILD_REQUIRES};
+	}
+	delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48;
+	delete $params{META_MERGE} if $eumm_version < 6.46;
+	delete $params{LICENSE} if $eumm_version < 6.31;
+	delete $params{AUTHOR} if $] < 5.005;
+
+	WriteMakefile(%params);
+}
diff --git a/README b/README
index d0adc45..ba7a89c 100644
--- a/README
+++ b/README
@@ -16,7 +16,7 @@ SYNOPSIS
         use Config::Tiny;
 
         # Create a config
-        my $Config = Config::Tiny->new();
+        my $Config = Config::Tiny->new;
 
         # Open the config
         $Config = Config::Tiny->read( 'file.conf' );
@@ -79,9 +79,9 @@ METHODS
     Returns the object on success, or "undef" on error.
 
     When "read" fails, "Config::Tiny" sets an error message internally you
-    can recover via "<Config::Tiny-"errstr>>. Although in some cases a
-    failed "read" will also set the operating system error variable $!, not
-    all errors do and you should not rely on using the $! variable.
+    can recover via "Config::Tiny->errstr". Although in some cases a failed
+    "read" will also set the operating system error variable $!, not all
+    errors do and you should not rely on using the $! variable.
 
   read_string $string;
     The "read_string" method takes as argument the contents of a config file
@@ -100,13 +100,14 @@ METHODS
     When an error occurs, you can retrieve the error message either from the
     $Config::Tiny::errstr variable, or using the "errstr()" method.
 
-  property_string
-    This method is called to produce the string used to represent the
-    property in a section. It is passed the section name and property name.
+CAVEATS
+  Unsupported Section Headers
+    Some edge cases in section headers are not support, and additionally may
+    not be detected when writing the config file.
 
-  set
-    This is a convenience is called to set a value found in the parsed
-    config string. It is passed the section name, property name, and value.
+    Specifically, section headers with leading whitespace, trailing
+    whitespace, or newlines anywhere in the section header, will not be
+    written correctly to the file and may cause file corruption.
 
 SUPPORT
     Bugs should be reported via the CPAN bug tracker at
@@ -127,7 +128,7 @@ SEE ALSO
     Config::Simple, Config::General, ali.as
 
 COPYRIGHT
-    Copyright 2002 - 2007 Adam Kennedy.
+    Copyright 2002 - 2010 Adam Kennedy.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
diff --git a/debian/changelog b/debian/changelog
index b61b430..70e7d36 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-libconfig-tiny-perl (2.12-2) UNRELEASED; urgency=low
+libconfig-tiny-perl (2.13-1) UNRELEASED; urgency=low
 
-  * NOT RELEASED YET
+  * New upstream release
 
- -- Dominic Hargreaves <dom at earth.li>  Tue, 26 Feb 2008 23:26:42 +0000
+ -- Dominic Hargreaves <dom at earth.li>  Sat, 05 Feb 2011 12:25:43 +0000
 
 libconfig-tiny-perl (2.12-1) unstable; urgency=low
 
diff --git a/lib/Config/Tiny.pm b/lib/Config/Tiny.pm
index 4cb8620..607412a 100755
--- a/lib/Config/Tiny.pm
+++ b/lib/Config/Tiny.pm
@@ -5,7 +5,7 @@ package Config::Tiny;
 use strict;
 BEGIN {
 	require 5.004;
-	$Config::Tiny::VERSION = '2.12';
+	$Config::Tiny::VERSION = '2.13';
 	$Config::Tiny::errstr  = '';
 }
 
@@ -24,9 +24,9 @@ sub read {
 
 	# Slurp in the file
 	local $/ = undef;
-	open CFG, $file or return $class->_error( "Failed to open file '$file': $!" );
+	open( CFG, $file ) or return $class->_error( "Failed to open file '$file': $!" );
 	my $contents = <CFG>;
-	close CFG;
+	close( CFG );
 
 	$class->read_string( $contents );
 }
@@ -78,10 +78,12 @@ sub write {
 		);
 
 	# Write it to the file
+	my $string = $self->write_string;
+	return undef unless defined $string;
 	open( CFG, '>' . $file ) or return $self->_error(
 		"Failed to open file '$file' for writing: $!"
 		);
-	print CFG $self->write_string;
+	print CFG $string;
 	close CFG;
 }
 
@@ -91,6 +93,15 @@ sub write_string {
 
 	my $contents = '';
 	foreach my $section ( sort { (($b eq '_') <=> ($a eq '_')) || ($a cmp $b) } keys %$self ) {
+		# Check for several known-bad situations with the section
+		# 1. Leading whitespace
+		# 2. Trailing whitespace
+		# 3. Newlines in section name
+		if ( $section =~ /(?:^\s|\n|\s$)/s ) {
+			return $self->_error(
+				"Illegal whitespace in section name '$section'"
+			);
+		}
 		my $block = $self->{$section};
 		$contents .= "\n" if length $contents;
 		$contents .= "[$section]\n" unless $section eq '_';
@@ -131,7 +142,7 @@ Config::Tiny - Read/Write .ini style files with as little code as possible
     use Config::Tiny;
 
     # Create a config
-    my $Config = Config::Tiny->new();
+    my $Config = Config::Tiny->new;
 
     # Open the config
     $Config = Config::Tiny->read( 'file.conf' );
@@ -196,7 +207,7 @@ C<Config::Tiny> object containing the properties in the file.
 Returns the object on success, or C<undef> on error.
 
 When C<read> fails, C<Config::Tiny> sets an error message internally
-you can recover via C<<Config::Tiny->errstr>>. Although in B<some>
+you can recover via C<Config::Tiny-E<gt>errstr>. Although in B<some>
 cases a failed C<read> will also set the operating system error
 variable C<$!>, not all errors do and you should not rely on using
 the C<$!> variable.
@@ -222,15 +233,16 @@ Generates the file content for the object and returns it as a string.
 When an error occurs, you can retrieve the error message either from the
 C<$Config::Tiny::errstr> variable, or using the C<errstr()> method.
 
-=head2 property_string
+=head1 CAVEATS
 
-This method is called to produce the string used to represent the property in a
-section.  It is passed the section name and property name.
+=head2 Unsupported Section Headers
 
-=head2 set
+Some edge cases in section headers are not support, and additionally may not
+be detected when writing the config file.
 
-This is a convenience is called to set a value found in the parsed config string.  It is
-passed the section name, property name, and value.
+Specifically, section headers with leading whitespace, trailing whitespace,
+or newlines anywhere in the section header, will not be written correctly
+to the file and may cause file corruption.
 
 =head1 SUPPORT
 
@@ -256,7 +268,7 @@ L<Config::Simple>, L<Config::General>, L<ali.as>
 
 =head1 COPYRIGHT
 
-Copyright 2002 - 2007 Adam Kennedy.
+Copyright 2002 - 2010 Adam Kennedy.
 
 This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.
diff --git a/t/02_main.t b/t/02_main.t
index 75d7b70..5fab94a 100644
--- a/t/02_main.t
+++ b/t/02_main.t
@@ -13,7 +13,7 @@ use Test::More tests => 33;
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '2.12';
+	$VERSION = '2.13';
 }
 
 
diff --git a/t/98_pod.t b/t/98_pod.t
deleted file mode 100644
index 8e61c1e..0000000
--- a/t/98_pod.t
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-BEGIN {
-	$|  = 1;
-	$^W = 1;
-}
-use Test::More;
-
-# Skip if doing a regular install
-unless ( $ENV{AUTOMATED_TESTING} ) {
-	plan( skip_all => "Author tests not required for installation" );
-}
-
-# Load the testing modules if we can
-eval "use Test::Pod 1.00";
-if ( $@ ) {
-	plan( skip_all => "Test::Pod not available for testing" );
-}
-
-all_pod_files_ok();
-exit(0);
-
-
-
-
-
-#####################################################################
-# WARNING: INSANE BLACK MAGIC
-#####################################################################
-
-# Hack Pod::Simple::BlackBox to ignore the Test::Inline
-# "Extended Begin" syntax.
-# For example, "=begin has more than one word errors"
-my $begin;
-if ( $Test::Pod::VERSION ) {
-	$begin = \&Pod::Simple::BlackBox::_ponder_begin;
-}
-sub mybegin {
-	my $para = $_[1];
-	my $content = join ' ', splice @$para, 2;
-	$content =~ s/^\s+//s;
-	$content =~ s/\s+$//s;
-	my @words = split /\s+/, $content;
-	if ( $words[0] =~ /^test(?:ing)?\z/s ) {
-		foreach ( 2 .. $#$para ) {
-			$para->[$_] = '';
-		}
-		$para->[2] = $words[0];
-	}
-
-	# Continue as normal
-	push @$para, @words;
-	return &$begin(@_);
-}
-
-SCOPE: {
-	local $^W = 0;
-	if ( $Test::Pod::VERSION ) {
-		*Pod::Simple::BlackBox::_ponder_begin = \&mybegin;
-	}
-}
-
-#####################################################################
-# END BLACK MAGIC
-#####################################################################
-
diff --git a/t/99_pmv.t b/t/99_pmv.t
deleted file mode 100644
index 55384b2..0000000
--- a/t/99_pmv.t
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-BEGIN {
-	$|  = 1;
-	$^W = 1;
-}
-use Test::More;
-
-# Skip if doing a regular install
-unless ( $ENV{AUTOMATED_TESTING} ) {
-	plan( skip_all => "Author tests not required for installation" );
-}
-
-# Can we run the version tests
-eval "use Test::MinimumVersion 0.007;";
-if ( $@ ) {
-	plan( skip_all => "Test::MinimumVersion not available" );
-}
-
-# Test minimum version
-all_minimum_version_from_metayml_ok();
diff --git a/xt/meta.t b/xt/meta.t
new file mode 100644
index 0000000..2f8b2c7
--- /dev/null
+++ b/xt/meta.t
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+
+# Test that our META.yml file matches the current specification.
+
+use strict;
+BEGIN {
+	$|  = 1;
+	$^W = 1;
+}
+
+my $MODULE = 'Test::CPAN::Meta 0.17';
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+	plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing module
+eval "use $MODULE";
+if ( $@ ) {
+	$ENV{RELEASE_TESTING}
+	? die( "Failed to load required release-testing module $MODULE" )
+	: plan( skip_all => "$MODULE not available for testing" );
+}
+
+meta_yaml_ok();
diff --git a/xt/pmv.t b/xt/pmv.t
new file mode 100644
index 0000000..84d6f6f
--- /dev/null
+++ b/xt/pmv.t
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+# Test that our declared minimum Perl version matches our syntax
+
+use strict;
+BEGIN {
+	$|  = 1;
+	$^W = 1;
+}
+
+my @MODULES = (
+	'Perl::MinimumVersion 1.25',
+	'Test::MinimumVersion 0.101080',
+);
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+	plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+	eval "use $MODULE";
+	if ( $@ ) {
+		$ENV{RELEASE_TESTING}
+		? die( "Failed to load required release-testing module $MODULE" )
+		: plan( skip_all => "$MODULE not available for testing" );
+	}
+}
+
+all_minimum_version_from_metayml_ok();
diff --git a/xt/pod.t b/xt/pod.t
new file mode 100644
index 0000000..170cae0
--- /dev/null
+++ b/xt/pod.t
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+
+# Test that the syntax of our POD documentation is valid
+
+use strict;
+BEGIN {
+	$|  = 1;
+	$^W = 1;
+}
+
+my @MODULES = (
+	'Pod::Simple 3.14',
+	'Test::Pod 1.44',
+);
+
+# Don't run tests for installs
+use Test::More;
+unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
+	plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+	eval "use $MODULE";
+	if ( $@ ) {
+		$ENV{RELEASE_TESTING}
+		? die( "Failed to load required release-testing module $MODULE" )
+		: plan( skip_all => "$MODULE not available for testing" );
+	}
+}
+
+all_pod_files_ok();

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



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