Hello community, here is the log from the commit of package perl-Config-Tiny for openSUSE:Factory checked in at 2017-10-11 23:02:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Config-Tiny (Old) and /work/SRC/openSUSE:Factory/.perl-Config-Tiny.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Config-Tiny" Wed Oct 11 23:02:45 2017 rev:16 rq:533128 version:2.23 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Config-Tiny/perl-Config-Tiny.changes 2015-03-23 12:19:18.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Config-Tiny.new/perl-Config-Tiny.changes 2017-10-11 23:02:50.492990257 +0200 @@ -1,0 +2,17 @@ +Sun Oct 8 08:08:29 UTC 2017 - co...@suse.com + +- updated to 2.23 + see /usr/share/doc/packages/perl-Config-Tiny/Changelog.ini + + [V 2.23] + Date=2015-10-14T09:11:00 + Comments= <<EOT + - Add the utf8 BOM to this file. Let's hope the CPAN toolchain can cope. If it can't, another + version of the code will have to be released. + - Fix read() and write() so they work on files called '0' (zero). See RT#107754. + Many thanx to Григорий Кудренко for the report and patch. + - Add t/05.zero.t and t/0 to test the new code. + - Reformat the source slightly. + EOT + +------------------------------------------------------------------- Old: ---- Config-Tiny-2.22.tgz New: ---- Config-Tiny-2.23.tgz cpanspec.yml ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Config-Tiny.spec ++++++ --- /var/tmp/diff_new_pack.SKxOId/_old 2017-10-11 23:02:51.544944169 +0200 +++ /var/tmp/diff_new_pack.SKxOId/_new 2017-10-11 23:02:51.548943993 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Config-Tiny # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,23 +16,24 @@ # -%define cpan_name Config-Tiny Name: perl-Config-Tiny -Version: 2.22 +Version: 2.23 Release: 0 +%define cpan_name Config-Tiny Summary: Read/Write .ini style files with as little code as possible License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Config-Tiny/ -Source: http://www.cpan.org/authors/id/R/RS/RSAVAGE/%{cpan_name}-%{version}.tgz +Source0: https://cpan.metacpan.org/authors/id/R/RS/RSAVAGE/%{cpan_name}-%{version}.tgz +Source1: cpanspec.yml +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(File::Spec) >= 3.3 BuildRequires: perl(File::Temp) >= 0.22 -BuildRequires: perl(Module::Build) >= 0.34 -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildArch: noarch -#BuildRequires: perl(Config::Tiny) +Requires: perl(File::Spec) >= 3.3 +Requires: perl(File::Temp) >= 0.22 %{perl_requires} %description @@ -48,25 +49,25 @@ This module is primarily for reading human written files, and anything we write shouldn't need to have documentation/comments. If you need something -with more power move up to the Config::Simple manpage, the Config::General -manpage or one of the many other 'Config::*' modules. +with more power move up to Config::Simple, Config::General or one of the +many other 'Config::*' modules. -Lastly, the Config::Tiny manpage does *not* preserve your comments, -whitespace, or the order of your config file. +Lastly, Config::Tiny does *not* preserve your comments, whitespace, or the +order of your config file. -See the Config::Tiny::Ordered manpage (and possibly others) for the -preservation of the order of the entries in the file. +See Config::Tiny::Ordered (and possibly others) for the preservation of the +order of the entries in the file. %prep %setup -q -n %{cpan_name}-%{version} -find . -type f -print0 | xargs -0 chmod 644 +find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644 %build -perl Makefile.PL installdirs=vendor -make %{?_smp_mflags} +%{__perl} Makefile.PL INSTALLDIRS=vendor +%{__make} %{?_smp_mflags} %check -make %{?_smp_mflags} test +%{__make} test %install %perl_make_install @@ -75,6 +76,7 @@ %files -f %{name}.files %defattr(-,root,root,755) -%doc Changelog.ini Changes LICENSE README test.conf xt +%doc Changes README test.conf +%license LICENSE %changelog ++++++ Config-Tiny-2.22.tgz -> Config-Tiny-2.23.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/Changelog.ini new/Config-Tiny-2.23/Changelog.ini --- old/Config-Tiny-2.22/Changelog.ini 2015-02-16 22:34:56.000000000 +0100 +++ new/Config-Tiny-2.23/Changelog.ini 2015-10-14 00:45:44.000000000 +0200 @@ -3,6 +3,17 @@ Changelog.Creator=Module::Metadata::Changes V 2.05 Changelog.Parser=Config::IniFiles V 2.83 +[V 2.23] +Date=2015-10-14T09:11:00 +Comments= <<EOT +- Add the utf8 BOM to this file. Let's hope the CPAN toolchain can cope. If it can't, another +version of the code will have to be released. +- Fix read() and write() so they work on files called '0' (zero). See RT#107754. +Many thanx to Григорий Кудренко for the report and patch. +- Add t/05.zero.t and t/0 to test the new code. +- Reformat the source slightly. +EOT + [V 2.22] Date=2015-02-17T08:32:00 Comments=- Fix licence info in Makefile.PL to say Perl. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/Changes new/Config-Tiny-2.23/Changes --- old/Config-Tiny-2.22/Changes 2015-02-16 22:33:05.000000000 +0100 +++ new/Config-Tiny-2.23/Changes 2015-10-14 00:45:44.000000000 +0200 @@ -1,4 +1,12 @@ -Revision history for Perl extension Config-Tiny: +Revision history for Perl extension Config-Tiny: + +2.23 Wed Oct 14 09:11:00 2015 + - Add the utf8 BOM to this file. Let's hope the CPAN toolchain can cope. If it can't, another + version of the code will have to be released. + - Fix read() and write() so they work on files called '0' (zero). See RT#107754. + Many thanx to Григорий Кудренко for the report and patch. + - Add t/05.zero.t and t/0 to test the new code. + - Reformat the source slightly. 2.22 Tue Feb 17 08:32:00 2015 - Fix licence info in Makefile.PL to say Perl. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/MANIFEST new/Config-Tiny-2.23/MANIFEST --- old/Config-Tiny-2.22/MANIFEST 2015-02-16 22:34:57.000000000 +0100 +++ new/Config-Tiny-2.23/MANIFEST 2015-10-14 00:45:44.000000000 +0200 @@ -7,11 +7,13 @@ META.json META.yml README +t/0 t/01.compile.t t/02.main.t t/03.read.string.t t/04.utf8.t t/04.utf8.txt +t/05.zero.t test.conf xt/meta.t xt/pmv.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/META.json new/Config-Tiny-2.23/META.json --- old/Config-Tiny-2.22/META.json 2015-02-16 22:34:58.000000000 +0100 +++ new/Config-Tiny-2.23/META.json 2015-10-14 00:45:44.000000000 +0200 @@ -4,7 +4,7 @@ "Adam Kennedy <ad...@cpan.org>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060", + "generated_by" : "ExtUtils::MakeMaker version 7.06, CPAN::Meta::Converter version 2.143240", "license" : [ "perl_5" ], @@ -52,5 +52,6 @@ "web" : "https://github.com/ronsavage/Config-Tiny" } }, - "version" : "2.22" + "version" : "2.23" } + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/META.yml new/Config-Tiny-2.23/META.yml --- old/Config-Tiny-2.22/META.yml 2015-02-16 22:34:58.000000000 +0100 +++ new/Config-Tiny-2.23/META.yml 2015-10-14 00:45:44.000000000 +0200 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060' +generated_by: 'ExtUtils::MakeMaker version 7.06, CPAN::Meta::Converter version 2.143240' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -27,4 +27,5 @@ resources: license: http://opensource.org/licenses/Perl repository: https://github.com/ronsavage/Config-Tiny.git -version: '2.22' +version: '2.23' + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/lib/Config/Tiny.pm new/Config-Tiny-2.23/lib/Config/Tiny.pm --- old/Config-Tiny-2.22/lib/Config/Tiny.pm 2015-02-16 22:33:13.000000000 +0100 +++ new/Config-Tiny-2.23/lib/Config/Tiny.pm 2015-10-14 00:45:44.000000000 +0200 @@ -6,122 +6,154 @@ # Warning: There is another version line, in t/02.main.t. -our $VERSION = '2.22'; +our $VERSION = '2.23'; BEGIN { require 5.008001; $Config::Tiny::errstr = ''; } -# Create an empty object -sub new { bless {}, shift } +# Create an empty object. -# Create an object from a file -sub read { - my $class = ref $_[0] ? ref shift : shift; - my $file = shift or return $class->_error('No file name provided'); +sub new { return bless {}, shift } + +# Create an object from a file. + +sub read +{ + my($class) = ref $_[0] ? ref shift : shift; + my($file, $encoding) = @_; + + return $class -> _error('No file name provided') if (! defined $file || ($file eq '') ); # Slurp in the file. - my $encoding = shift; - $encoding = $encoding ? "<:$encoding" : '<'; - local $/ = undef; + $encoding = $encoding ? "<:$encoding" : '<'; + local $/ = undef; - open( CFG, $encoding, $file ) or return $class->_error( "Failed to open file '$file' for reading: $!" ); + open( CFG, $encoding, $file ) or return $class -> _error( "Failed to open file '$file' for reading: $!" ); my $contents = <CFG>; close( CFG ); return $class -> _error("Reading from '$file' returned undef") if (! defined $contents); - return $class->read_string( $contents ); -} + return $class -> read_string( $contents ); + +} # End of read. + +# Create an object from a string. + +sub read_string +{ + my($class) = ref $_[0] ? ref shift : shift; + my($self) = bless {}, $class; -# Create an object from a string -sub read_string { - my $class = ref $_[0] ? ref shift : shift; - my $self = bless {}, $class; return undef unless defined $_[0]; - # Parse the file + # Parse the file. + my $ns = '_'; my $counter = 0; - foreach ( split /(?:\015{1,2}\012|\015|\012)/, shift ) { + + foreach ( split /(?:\015{1,2}\012|\015|\012)/, shift ) + { $counter++; - # Skip comments and empty lines + # Skip comments and empty lines. + next if /^\s*(?:\#|\;|$)/; - # Remove inline comments + # Remove inline comments. + s/\s\;\s.+$//g; - # Handle section headers - if ( /^\s*\[\s*(.+?)\s*\]\s*$/ ) { + # Handle section headers. + + if ( /^\s*\[\s*(.+?)\s*\]\s*$/ ) + { # Create the sub-hash if it doesn't exist. # Without this sections without keys will not # appear at all in the completed struct. + $self->{$ns = $1} ||= {}; + next; } - # Handle properties - if ( /^\s*([^=]+?)\s*=\s*(.*?)\s*$/ ) { + # Handle properties. + + if ( /^\s*([^=]+?)\s*=\s*(.*?)\s*$/ ) + { $self->{$ns}->{$1} = $2; + next; } - return $self->_error( "Syntax error at line $counter: '$_'" ); + return $self -> _error( "Syntax error at line $counter: '$_'" ); } - $self; + return $self; } -# Save an object to a file -sub write { - my $self = shift; - my $file = shift or return $self->_error('No file name provided'); - my $encoding = shift; - $encoding = $encoding ? ">:$encoding" : '>'; +# Save an object to a file. + +sub write +{ + my($self) = shift; + my($file, $encoding) = @_; + + return $self -> _error('No file name provided') if (! defined $file or ($file eq '') ); + + $encoding = $encoding ? ">:$encoding" : '>'; + + # Write it to the file. + + my($string) = $self->write_string; - # Write it to the file - my $string = $self->write_string; return undef unless defined $string; - open( CFG, $encoding, $file ) or return $self->_error( - "Failed to open file '$file' for writing: $!" - ); + + open( CFG, $encoding, $file ) or return $self->_error("Failed to open file '$file' for writing: $!"); print CFG $string; close CFG; return 1; -} -# Save an object to a string -sub write_string { - my $self = shift; +} # End of write. + +# Save an object to a string. - my $contents = ''; - foreach my $section ( sort { (($b eq '_') <=> ($a eq '_')) || ($a cmp $b) } keys %$self ) { +sub write_string +{ + my($self) = shift; + my($contents) = ''; + + for 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 - return $self->_error( - "Illegal whitespace in section name '$section'" - ) if $section =~ /(?:^\s|\n|\s$)/s; + # 3. Newlines in section name. + + return $self->_error("Illegal whitespace in section name '$section'") if $section =~ /(?:^\s|\n|\s$)/s; + my $block = $self->{$section}; $contents .= "\n" if length $contents; $contents .= "[$section]\n" unless $section eq '_'; - foreach my $property ( sort keys %$block ) { - return $self->_error( - "Illegal newlines in property '$section.$property'" - ) if $block->{$property} =~ /(?:\012|\015)/s; + + for my $property ( sort keys %$block ) + { + return $self->_error("Illegal newlines in property '$section.$property'") if $block->{$property} =~ /(?:\012|\015)/s; + $contents .= "$property=$block->{$property}\n"; } } - $contents; -} + return $contents; + +} # End of write_string. + +# Error handling. -# Error handling sub errstr { $Config::Tiny::errstr } sub _error { $Config::Tiny::errstr = $_[1]; undef } @@ -183,11 +215,9 @@ =head1 DESCRIPTION C<Config::Tiny> is a Perl class to read and write .ini style configuration -files with as little code as possible, reducing load time and memory -overhead. +files with as little code as possible, reducing load time and memory overhead. -Most of the time it is accepted that Perl applications use a lot -of memory and modules. +Most of the time it is accepted that Perl applications use a lot of memory and modules. The C<*::Tiny> family of modules is specifically intended to provide an ultralight alternative to the standard modules. @@ -330,6 +360,10 @@ my($value) = ${Config::Tiny -> read_string('alpha=bet')}{_}{alpha}; # $value is 'bet'. +=head2 Can I use a file called '0' (zero)? + +Yes. See t/05.zero.t (test code) and t/0 (test data). + =head1 CAVEATS =head2 Unsupported Section Headers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/t/0 new/Config-Tiny-2.23/t/0 --- old/Config-Tiny-2.22/t/0 1970-01-01 01:00:00.000000000 +0100 +++ new/Config-Tiny-2.23/t/0 2015-10-14 00:45:44.000000000 +0200 @@ -0,0 +1,2 @@ +[init] +a=b diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/t/02.main.t new/Config-Tiny-2.23/t/02.main.t --- old/Config-Tiny-2.22/t/02.main.t 2015-02-16 22:34:16.000000000 +0100 +++ new/Config-Tiny-2.23/t/02.main.t 2015-10-14 00:45:44.000000000 +0200 @@ -19,7 +19,7 @@ # Warning: There is another version line, in lib/Config/Tiny.pm. -our $VERSION = '2.22'; +our $VERSION = '2.23'; # -------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-Tiny-2.22/t/05.zero.t new/Config-Tiny-2.23/t/05.zero.t --- old/Config-Tiny-2.22/t/05.zero.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Config-Tiny-2.23/t/05.zero.t 2015-10-14 00:45:44.000000000 +0200 @@ -0,0 +1,38 @@ +#!/usr/bin/perl + +use Config::Tiny; + +use File::Spec; +use File::Temp; + +use Test::More tests => 6; + +use utf8; + +# ------------------------ + +my($conf0) = Config::Tiny -> read('t/0'); + +ok($$conf0{init}{a} eq 'b', 'Hashref after read() returns correct value'); + +# The EXLOCK option is for BSD-based systems. + +my($temp_dir) = File::Temp -> newdir('temp.XXXX', CLEANUP => 1, EXLOCK => 0, TMPDIR => 1); +my($temp_file) = File::Spec -> catfile($temp_dir, '0'); +my($string) =<<EOS; +[init] +a = b +EOS +my($conf1) = Config::Tiny -> read_string($string); + +ok($conf1, 'read_string() returns true'); + +is_deeply($conf1, {init => {a => 'b'} }, 'read_string() returns expected value'); + +$conf1 -> write($temp_file); + +my($conf2) = Config::Tiny -> read($temp_file); + +is_deeply($conf1, $conf1, 'write() followed by read() works'); +is_deeply($conf2, {init => {a => 'b'} }, 'write() + read() returns expected value'); +is_deeply($conf0, {init => {a => 'b'} }, 'write() + read() returns expected value'); ++++++ cpanspec.yml ++++++ --- #description_paragraphs: 3 #description: |- # override description from CPAN #summary: override summary from CPAN #no_testing: broken upstream #sources: # - source1 # - source2 #patches: # foo.patch: -p1 # bar.patch: #preamble: |- # BuildRequires: gcc-c++ #post_prep: |- # hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'` # sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL #post_build: |- # rm unused.files #post_install: |- # sed on %{name}.files #license: SUSE-NonFree #skip_noarch: 1 #custom_build: |- #./Build build flags=%{?_smp_mflags} --myflag #custom_test: |- #startserver && make test #ignore_requires: Bizarre::Module