Hello community, here is the log from the commit of package perl-Config-General for openSUSE:Factory checked in at 2013-06-05 17:49:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Config-General (Old) and /work/SRC/openSUSE:Factory/.perl-Config-General.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Config-General" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Config-General/perl-Config-General.changes 2011-09-23 12:36:27.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Config-General.new/perl-Config-General.changes 2013-06-05 17:49:46.000000000 +0200 @@ -1,0 +2,19 @@ +Mon Jun 3 15:52:42 UTC 2013 - co...@suse.com + +- updated to 2.51 + - fixed rt.cpan.org#77667 which resulted in invalid configs + written to file when using save_file() and a named block, + whose 2nd part starts with a /. + + - fixed rt.cpan.org#64169 by applying patch by Dulaunoy Fabrice. + adds -NoEscape switch which turns off escaping of anything. + + - implemented suggestion of rt.cpan.org#67564 by adding 3 new + parameters: -NormalizeOption, -NormalizeBlock and -NormalizeValue, + which take a subroutine reference and change the block, + option or value accordingly. + + - fixed rt.cpan.org#65860+76953 undefined value error. + + +------------------------------------------------------------------- Old: ---- Config-General-2.50.tar.gz New: ---- Config-General-2.51.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Config-General.spec ++++++ --- /var/tmp/diff_new_pack.ejJm4a/_old 2013-06-05 17:49:47.000000000 +0200 +++ /var/tmp/diff_new_pack.ejJm4a/_new 2013-06-05 17:49:47.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Config-General # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products 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,28 +16,22 @@ # - Name: perl-Config-General -Version: 2.50 -Release: 3 -License: GPL-1.0+ or Artistic-1.0 +Version: 2.51 +Release: 0 %define cpan_name Config-General Summary: Generic Config Module -Url: http://search.cpan.org/dist/Config-General/ +License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl -#Source: http://www.cpan.org/authors/id/T/TL/TLINDEN/Config-General-%{version}.tar.gz -Source: %{cpan_name}-%{version}.tar.gz +Url: http://search.cpan.org/dist/Config-General/ +Source: http://www.cpan.org/authors/id/T/TL/TLINDEN/%{cpan_name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros -BuildRequires: perl(File::Glob) -BuildRequires: perl(FileHandle) -BuildRequires: perl(File::Spec::Functions) -BuildRequires: perl(IO::File) -Requires: perl(File::Glob) -Requires: perl(FileHandle) -Requires: perl(File::Spec::Functions) -Requires: perl(IO::File) +#BuildRequires: perl(Config::General) >= 1.18 +#BuildRequires: perl(Config::General::Extended) +#BuildRequires: perl(Config::General::Interpolated) +#BuildRequires: perl(Tie::IxHash) %{perl_requires} %description @@ -69,11 +63,8 @@ %perl_process_packlist %perl_gen_filelist -%clean -%{__rm} -rf %{buildroot} - %files -f %{name}.files -%defattr(644,root,root,755) -%doc Changelog README TODO +%defattr(-,root,root,755) +%doc Changelog README %changelog ++++++ Config-General-2.50.tar.gz -> Config-General-2.51.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/Changelog new/Config-General-2.51/Changelog --- old/Config-General-2.50/Changelog 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/Changelog 2012-07-18 14:58:52.000000000 +0200 @@ -1,3 +1,18 @@ + 2.51 - fixed rt.cpan.org#77667 which resulted in invalid configs + written to file when using save_file() and a named block, + whose 2nd part starts with a /. + + - fixed rt.cpan.org#64169 by applying patch by Dulaunoy Fabrice. + adds -NoEscape switch which turns off escaping of anything. + + - implemented suggestion of rt.cpan.org#67564 by adding 3 new + parameters: -NormalizeOption, -NormalizeBlock and -NormalizeValue, + which take a subroutine reference and change the block, + option or value accordingly. + + - fixed rt.cpan.org#65860+76953 undefined value error. + + 2.50 - fixed rt.cpan.org#63487 documentation error. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/General/Extended.pm new/Config-General-2.51/General/Extended.pm --- old/Config-General-2.50/General/Extended.pm 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/General/Extended.pm 2012-07-18 15:05:30.000000000 +0200 @@ -1,7 +1,7 @@ # # Config::General::Extended - special Class based on Config::General # -# Copyright (c) 2000-2010 Thomas Linden <tlinden |AT| cpan.org>. +# Copyright (c) 2000-2012 Thomas Linden <tlinden |AT| cpan.org>. # All Rights Reserved. Std. disclaimer applies. # Artistic License, same as perl itself. Have fun. # @@ -621,7 +621,7 @@ =head1 COPYRIGHT -Copyright (c) 2000-2010 Thomas Linden +Copyright (c) 2000-2012 Thomas Linden This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/General/Interpolated.pm new/Config-General-2.51/General/Interpolated.pm --- old/Config-General-2.50/General/Interpolated.pm 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/General/Interpolated.pm 2012-07-18 15:05:30.000000000 +0200 @@ -2,7 +2,7 @@ # Config::General::Interpolated - special Class based on Config::General # # Copyright (c) 2001 by Wei-Hon Chen <plasmab...@pchome.com.tw>. -# Copyright (c) 2000-2010 by Thomas Linden <tlinden |AT| cpan.org>. +# Copyright (c) 2000-2012 by Thomas Linden <tlinden |AT| cpan.org>. # All Rights Reserved. Std. disclaimer applies. # Artistic License, same as perl itself. Have fun. # @@ -341,7 +341,7 @@ =head1 COPYRIGHT Copyright 2001 by Wei-Hon Chen E<lt>plasmab...@pchome.com.twe<gt>. -Copyright 2002-2010 by Thomas Linden <tlinden |AT| cpan.org>. +Copyright 2002-2012 by Thomas Linden <tlinden |AT| cpan.org>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/General.pm new/Config-General-2.51/General.pm --- old/Config-General-2.50/General.pm 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/General.pm 2012-07-18 15:06:49.000000000 +0200 @@ -5,7 +5,7 @@ # config values from a given file and # return it as hash structure # -# Copyright (c) 2000-2010 Thomas Linden <tlinden |AT| cpan.org>. +# Copyright (c) 2000-2012 Thomas Linden <tlinden |AT| cpan.org>. # All Rights Reserved. Std. disclaimer applies. # Artistic License, same as perl itself. Have fun. # @@ -32,7 +32,7 @@ use Carp; use Exporter; -$Config::General::VERSION = "2.50"; +$Config::General::VERSION = "2.51"; use vars qw(@ISA @EXPORT_OK); use base qw(Exporter); @@ -88,7 +88,11 @@ UTF8 => 0, SaveSorted => 0, ForceArray => 0, # force single value array if value enclosed in [] - AllowSingleQuoteInterpolation => 0 + AllowSingleQuoteInterpolation => 0, + NoEscape => 0, + NormalizeBlock => 0, + NormalizeOption => 0, + NormalizeValue => 0, }; # create the class instance @@ -791,6 +795,10 @@ } } + if($this->{NormalizeOption}) { + $option = $this->{NormalizeOption}($option); + } + if ($value && $value =~ /^"/ && $value =~ /"$/) { $value =~ s/^"//; # remove leading and trailing " $value =~ s/"$//; @@ -809,6 +817,16 @@ $blockname = $3 || $4; } } + if($this->{NormalizeBlock}) { + $block = $this->{NormalizeBlock}($block); + if (defined $blockname) { + $blockname = $this->{NormalizeBlock}($blockname); + if($blockname eq "") { + # if, after normalization no blockname is left, remove it + $blockname = undef; + } + } + } if ($this->{InterPolateVars}) { # interpolate block(name), add "<" and ">" to the key, because # it is sure that such keys does not exist otherwise. @@ -869,7 +887,7 @@ } } else { - if($this->{ForceArray} && $value =~ /^\[\s*(.+?)\s*\]$/) { + if($this->{ForceArray} && defined $value && $value =~ /^\[\s*(.+?)\s*\]$/) { # force single value array entry push @{$config->{$option}}, $this->_parse_value($config, $option, $1); } @@ -949,7 +967,6 @@ if ($this->{InterPolateVars}) { # inherit current __stack to new block $tmphash->{__stack} = $this->_copy($config->{__stack}); - #$tmphash->{__stack} = $config->{$block}->{__stack}; } $config->{$block}->{$blockname} = $this->_parse($tmphash, \@newcontent); @@ -1057,6 +1074,10 @@ return $value; } + if($this->{NormalizeValue}) { + $value = $this->{NormalizeValue}($value); + } + if ($this->{InterPolateVars}) { $value = $this->_interpolate($config, $option, $value); } @@ -1087,8 +1108,10 @@ } } - # are there any escaped characters left? put them out as is - $value =~ s/\\([\$\\\"#])/$1/g; + if (!$this->{NoEscape}) { + # are there any escaped characters left? put them out as is + $value =~ s/\\([\$\\\"#])/$1/g; + } return $value; } @@ -1277,8 +1300,10 @@ else { # a simple stupid scalar entry - # re-escape contained $ or # or \ chars - $line =~ s/([#\$\\\"])/\\$1/g; + if (!$this->{NoEscape}) { + # re-escape contained $ or # or \ chars + $line =~ s/([#\$\\\"])/\\$1/g; + } # bugfix rt.cpan.org#42287 if ($line =~ /^\s/ or $line =~ /\s$/) { @@ -1306,6 +1331,20 @@ $entry = q(") . $entry . q("); } + # check if the next level key points to a hash and is the only one + # in this case put out a named block + # fixes rt.77667 + my $num = scalar keys %{$line}; + if($num == 1) { + my $key = (keys %{$line})[0]; + if(ref($line->{$key}) eq 'HASH') { + $config_string .= $indent . qq(<$entry $key>\n); + $config_string .= $this->_store($level + 1, $line->{$key}); + $config_string .= $indent . qq(</) . $entry . ">\n"; + return $config_string; + } + } + $config_string .= $indent . q(<) . $entry . ">\n"; $config_string .= $this->_store($level + 1, $line); $config_string .= $indent . q(</) . $entry . ">\n"; @@ -1881,7 +1920,7 @@ IncludeDirectories = 1 IncludeGlob = 1 SlashIsDirectory = 1 - SplitPolicy = 'equalsign' + SplitPolicy = 'whitespace' CComments = 0 Take a look into the particular documentation sections what @@ -1900,6 +1939,32 @@ If you want to save configs in a sorted manner, turn this parameter on. It is not enabled by default. +=item B<-NoEscape> + +If you want to use the data ( scalar or final leaf ) without escaping special charatecter, turn this +parameter on. It is not enabled by default. + +=item B<-NormalizeBlock> + +Takes a subroutine reference as parameter and gets the current +block or blockname passed as parameter and is expected to return +it in some altered way as a scalar string. The sub will be called +before anything else will be done by the module itself (e.g. interpolation). + +Example: + + -NormalizeBlock => sub { my $x = shift; $x =~ s/\s*$//; $x; } + +This removes trailing whitespaces of block names. + +=item B<-NormalizeOption> + +Same as B<-NormalizeBlock> but applied on options only. + +=item B<-NormalizeValue> + +Same as B<-NormalizeBlock> but applied on values only. + =back @@ -2512,7 +2577,7 @@ =head1 LICENSE AND COPYRIGHT -Copyright (c) 2000-2010 Thomas Linden +Copyright (c) 2000-2012 Thomas Linden This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -2541,7 +2606,7 @@ =head1 VERSION -2.50 +2.51 =cut diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/META.yml new/Config-General-2.51/META.yml --- old/Config-General-2.50/META.yml 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/META.yml 2012-07-18 15:07:24.000000000 +0200 @@ -1,16 +1,24 @@ -name: Config-General -version: 2.50 -version_from: General.pm -installdirs: site +--- #YAML:1.0 +name: Config-General +version: 2.51 +abstract: ~ +author: [] +license: perl +distribution_type: module +configure_requires: + ExtUtils::MakeMaker: 0 +build_requires: + ExtUtils::MakeMaker: 0 requires: - File::Glob: 0 - File::Spec::Functions: 0 - FileHandle: 0 - IO::File: 0 -resources: - bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Config-General - homepage: http://search.cpan.org/dist/Config-General/ - license: http://dev.perl.org/licenses/artistic.html - repository: http://dev.catalyst.perl.org/repos/Config-General -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.30 + File::Glob: 0 + File::Spec::Functions: 0 + FileHandle: 0 + IO::File: 0 +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.55_02 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/Makefile.PL new/Config-General-2.51/Makefile.PL --- old/Config-General-2.50/Makefile.PL 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/Makefile.PL 2012-07-18 15:05:30.000000000 +0200 @@ -1,7 +1,7 @@ # # Makefile.PL - build file for Config::General # -# Copyright (c) 2000-2010 Thomas Linden <t...@daemon.de>. +# Copyright (c) 2000-2012 Thomas Linden <t...@daemon.de>. # All Rights Reserved. Std. disclaimer applies. # Artistic License, same as perl itself. Have fun. # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/TODO new/Config-General-2.51/TODO --- old/Config-General-2.50/TODO 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/TODO 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ - - - o need separate methods like ::String or ::File to fill - module parameters, and ::Parse and/or ::Read for manually - invocation of the parser diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/t/PathObject.pm new/Config-General-2.51/t/PathObject.pm --- old/Config-General-2.50/t/PathObject.pm 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/t/PathObject.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,24 +0,0 @@ -# -# Pathobject fake module to test Config::General -# without the need to install Path::Class::File module. -# -# Submitted by Matt S Trout, Copyright (c) 2009 Matt S Trout. - - -package PathObject; - -use overload ('""' => 'stringify'); - -sub new { - my $class = shift; - my $self = {}; - bless $self, $class; - return $self; -} - -sub stringify { - my ($self) = @_; - return "t/test.rc"; -} - -1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.50/t/run.t new/Config-General-2.51/t/run.t --- old/Config-General-2.50/t/run.t 2010-12-01 11:43:00.000000000 +0100 +++ new/Config-General-2.51/t/run.t 2012-07-18 13:56:29.000000000 +0200 @@ -8,7 +8,7 @@ use Data::Dumper; -use Test::More tests => 68; +use Test::More tests => 69; #use Test::More qw(no_plan); # ahem, we deliver the test code with a local copy of @@ -731,4 +731,7 @@ # Make sure no warnings were seen during the test. ok( !@WARNINGS_FOUND, "No unexpected warnings seen" ); - +# check if disabling escape chars does work +my $cfg54 = new Config::General(-NoEscape => 1, -String => qq(val = \\\$notavar:\\blah\n)); +my %hash54 = $cfg54->getall(); +is($hash54{val}, qq(\\\$notavar:\\blah), "check -NoEscape"); -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org