Hello community,
here is the log from the commit of package perl-Config-General for openSUSE:Factory
checked in at Fri Apr 16 18:37:06 CEST 2010.
--------
--- perl-Config-General/perl-Config-General.changes 2010-04-04 22:24:07.000000000 +0200
+++ /mounts/work_src_done/STABLE/perl-Config-General/perl-Config-General.changes 2010-04-16 14:03:29.000000000 +0200
@@ -1,0 +2,20 @@
+Fri Apr 16 12:01:01 UTC 2010 - chris@computersalat.de
+
+- update to 2.48
+ - arg, uploaded the wrong file to pause, so another version
+ bump up.
+ - fixed typos in pod section for -ForceArray.
+- 2.47
+ - fixed rt.cpan.org#53759 by adding new option -ForceArray.
+ when enabled a single config value enclosed in [] will become
+ an array forcefully.
+ - fixed typo in license: it is "artistic", not "artificial".
+- 2.46
+ - fixed rt.cpan.org#56370: there was a sort() call in _store()
+ left, which lead to sorted arrays even if -SaveSorted were
+ turned off.
+- removed Provides {cpan_name}
+- removed .packlist, perllocal.pod
+ > noarch
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
Config-General-2.45.tar.bz2
New:
----
Config-General-2.48.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Config-General.spec ++++++
--- /var/tmp/diff_new_pack.ccnbfI/_old 2010-04-16 18:36:09.000000000 +0200
+++ /var/tmp/diff_new_pack.ccnbfI/_new 2010-04-16 18:36:09.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package perl-Config-General (Version 2.45)
+# spec file for package perl-Config-General (Version 2.48)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -21,19 +21,19 @@
Name: perl-Config-General
%define cpan_name %( echo %{name} | %{__sed} -e 's,perl-,,' )
Summary: Generic Config Module
-Version: 2.45
+Version: 2.48
Release: 1
License: Artistic License .. ; GPLv2+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Config-General
Source0: %{cpan_name}-%{version}.tar.bz2
+BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
%if 0%{?suse_version} < 1120
BuildRequires: perl-macros
%endif
Requires: perl = %{perl_version}
-Provides: %{cpan_name}
%description
This module opens a config file and parses it's contents
@@ -73,7 +73,11 @@
%install
%perl_make_install
-%perl_process_packlist
+# do not perl_process_packlist (noarch)
+# remove .packlist file
+%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
+# remove perllocal.pod file
+%{__rm} -rf $RPM_BUILD_ROOT%perl_archlib
%perl_gen_filelist
%clean
@@ -81,6 +85,6 @@
%files -f %{name}.files
%defattr(-, root, root)
-%doc Changelog README example.cfg
+%doc Changelog README TODO example.cfg
%changelog
++++++ Config-General-2.45.tar.bz2 -> Config-General-2.48.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.45/Changelog new/Config-General-2.48/Changelog
--- old/Config-General-2.45/Changelog 2010-04-02 23:20:18.000000000 +0200
+++ new/Config-General-2.48/Changelog 2010-04-09 15:40:45.000000000 +0200
@@ -1,4 +1,25 @@
-2.45
+ 2.48
+ - arg, uploaded the wrong file to pause, so another version
+ bump up.
+
+ - fixed typos in pod section for -ForceArray.
+
+
+ 2.47
+ - fixed rt.cpan.org#53759 by adding new option -ForceArray.
+ when enabled a single config value enclosed in [] will become
+ an array forcefully.
+
+ - fixed typo in license: it is "artistic", not "artificial".
+
+
+ 2.46
+ - fixed rt.cpan.org#56370: there was a sort() call in _store()
+ left, which lead to sorted arrays even if -SaveSorted were
+ turned off.
+
+
+ 2.45
- fixed rt.cpan.org#50647 escaping bug. Now escaped $ or
backslash characters are handled correctly (across save too)
@@ -14,11 +35,11 @@
or autotrue and the like) but returned as undef untouched.
-2.44
+ 2.44
- fixed rt.cpan.org#49023 by rolling back change in 2.43
in line 158, regarding GLOB support.
-2.43
+ 2.43
- fixed rt.cpan.org#40925, $indichar replaced by internal
configuration variable EOFseparator, which contains
a 256 bit SHA checksum of the date I fixed the bug.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.45/General/Extended.pm new/Config-General-2.48/General/Extended.pm
--- old/Config-General-2.45/General/Extended.pm 2009-07-15 20:16:13.000000000 +0200
+++ new/Config-General-2.48/General/Extended.pm 2010-04-09 11:05:40.000000000 +0200
@@ -3,7 +3,7 @@
#
# Copyright (c) 2000-2008 Thomas Linden .
# All Rights Reserved. Std. disclaimer applies.
-# Artificial License, same as perl itself. Have fun.
+# Artistic License, same as perl itself. Have fun.
#
# namespace
@@ -23,7 +23,7 @@
use strict;
-$Config::General::Extended::VERSION = "2.03";
+$Config::General::Extended::VERSION = "2.04";
sub new {
@@ -593,7 +593,7 @@
=head1 VERSION
-2.03
+2.04
=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.45/General/Interpolated.pm new/Config-General-2.48/General/Interpolated.pm
--- old/Config-General-2.45/General/Interpolated.pm 2010-04-02 23:11:31.000000000 +0200
+++ new/Config-General-2.48/General/Interpolated.pm 2010-04-09 11:05:56.000000000 +0200
@@ -4,11 +4,11 @@
# Copyright (c) 2001 by Wei-Hon Chen .
# Copyright (c) 2000-2010 by Thomas Linden .
# All Rights Reserved. Std. disclaimer applies.
-# Artificial License, same as perl itself. Have fun.
+# Artistic License, same as perl itself. Have fun.
#
package Config::General::Interpolated;
-$Config::General::Interpolated::VERSION = "2.12";
+$Config::General::Interpolated::VERSION = "2.13";
use strict;
use Carp;
@@ -347,7 +347,7 @@
=head1 VERSION
-2.12
+2.13
=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.45/General.pm new/Config-General-2.48/General.pm
--- old/Config-General-2.45/General.pm 2010-04-02 23:12:29.000000000 +0200
+++ new/Config-General-2.48/General.pm 2010-04-09 15:40:45.000000000 +0200
@@ -5,9 +5,9 @@
# config values from a given file and
# return it as hash structure
#
-# Copyright (c) 2000-20010Thomas Linden .
+# Copyright (c) 2000-2010 Thomas Linden .
# All Rights Reserved. Std. disclaimer applies.
-# Artificial License, same as perl itself. Have fun.
+# Artistic License, same as perl itself. Have fun.
#
# namespace
package Config::General;
@@ -32,7 +32,7 @@
use Carp;
use Exporter;
-$Config::General::VERSION = 2.45;
+$Config::General::VERSION = 2.48;
use vars qw(@ISA @EXPORT_OK);
use base qw(Exporter);
@@ -86,7 +86,8 @@
parsed => 0, # internal state stuff for variable interpolation
files => {}, # which files we have read, if any
UTF8 => 0,
- SaveSorted => 0
+ SaveSorted => 0,
+ ForceArray => 0 # force single value array if value enclosed in []
};
# create the class instance
@@ -864,13 +865,19 @@
}
}
else {
- # standard config option, insert key/value pair into node
- $config->{$option} = $this->_parse_value($config, $option, $value);
+ if($this->{ForceArray} && $value =~ /^\[\s*(.+?)\s*\]$/) {
+ # force single value array entry
+ push @{$config->{$option}}, $this->_parse_value($config, $option, $1);
+ }
+ else {
+ # standard config option, insert key/value pair into node
+ $config->{$option} = $this->_parse_value($config, $option, $value);
- if ($this->{InterPolateVars}) {
- # save pair on local stack
- $config->{__stack}->{$option} = $config->{$option};
- }
+ if ($this->{InterPolateVars}) {
+ # save pair on local stack
+ $config->{__stack}->{$option} = $config->{$option};
+ }
+ }
}
}
}
@@ -1201,12 +1208,18 @@
foreach my $entry ( $this->{SaveSorted} ? sort keys %$config : keys %$config ) {
if (ref($config->{$entry}) eq 'ARRAY') {
- foreach my $line (sort @{$config->{$entry}}) {
- if (ref($line) eq 'HASH') {
- $config_string .= $this->_write_hash($level, $entry, $line);
- }
- else {
- $config_string .= $this->_write_scalar($level, $entry, $line);
+ if( $this->{ForceArray} && scalar @{$config->{$entry}} == 1 && ! ref($config->{$entry}->[0]) ) {
+ # a single value array forced to stay as array
+ $config_string .= $this->_write_scalar($level, $entry, '[' . $config->{$entry}->[0] . ']');
+ }
+ else {
+ foreach my $line ( $this->{SaveSorted} ? sort @{$config->{$entry}} : @{$config->{$entry}} ) {
+ if (ref($line) eq 'HASH') {
+ $config_string .= $this->_write_hash($level, $entry, $line);
+ }
+ else {
+ $config_string .= $this->_write_scalar($level, $entry, $line);
+ }
}
}
}
@@ -2154,7 +2167,7 @@
-=head1 IDENTICAL OPTIONS
+=head1 IDENTICAL OPTIONS (ARRAYS)
You may have more than one line of the same option with different values.
@@ -2229,7 +2242,16 @@
If turned off, Config::General will complain about multiple occurring options
with identical names!
+=head2 FORCE SINGLE VALUE ARRAYS
+
+You may also force a single config line to get parsed into an array by
+turning on the option B<-ForceArray> and by surrounding the value of the
+config entry by []. Example:
+
+ hostlist = [ foo.bar ]
+Will be a singlevalue array entry if the option is turned on. If you want
+it to remain to be an array you have to turn on B<-ForceArray> during save too.
=head1 LONG LINES
@@ -2510,7 +2532,7 @@
=head1 VERSION
-2.45
+2.48
=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.45/META.yml new/Config-General-2.48/META.yml
--- old/Config-General-2.45/META.yml 2010-04-02 23:23:02.000000000 +0200
+++ new/Config-General-2.48/META.yml 2010-04-09 11:04:08.000000000 +0200
@@ -1,5 +1,3 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Config-General
version: 2.45
version_from: General.pm
@@ -9,6 +7,10 @@
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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.45/Makefile.PL new/Config-General-2.48/Makefile.PL
--- old/Config-General-2.45/Makefile.PL 2008-12-17 22:09:40.000000000 +0100
+++ new/Config-General-2.48/Makefile.PL 2010-04-09 11:06:19.000000000 +0200
@@ -1,9 +1,9 @@
#
# Makefile.PL - build file for Config::General
#
-# Copyright (c) 2000-2007 Thomas Linden .
+# Copyright (c) 2000-2010 Thomas Linden .
# All Rights Reserved. Std. disclaimer applies.
-# Artificial License, same as perl itself. Have fun.
+# Artistic License, same as perl itself. Have fun.
#
use ExtUtils::MakeMaker;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.45/TODO new/Config-General-2.48/TODO
--- old/Config-General-2.45/TODO 1970-01-01 01:00:00.000000000 +0100
+++ new/Config-General-2.48/TODO 2010-04-09 10:49:50.000000000 +0200
@@ -0,0 +1,5 @@
+
+
+ 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.45/t/PathObject.pm new/Config-General-2.48/t/PathObject.pm
--- old/Config-General-2.45/t/PathObject.pm 1970-01-01 01:00:00.000000000 +0100
+++ new/Config-General-2.48/t/PathObject.pm 2010-04-09 10:49:50.000000000 +0200
@@ -0,0 +1,24 @@
+#
+# 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.45/t/cfg.8 new/Config-General-2.48/t/cfg.8
--- old/Config-General-2.45/t/cfg.8 2010-04-02 22:28:23.000000000 +0200
+++ new/Config-General-2.48/t/cfg.8 2010-04-09 10:49:50.000000000 +0200
@@ -8,8 +8,9 @@
age 31
</officer>
</cops>
+domain nix.to
domain b0fh.org
-domain b0fh.org
+domain foo.bar
message < 57;
-use Test::More qw(no_plan);
+use Test::More tests => 63;
+#use Test::More qw(no_plan);
# ahem, we deliver the test code with a local copy of
# the Tie::IxHash module so we can do tests on sorted
@@ -702,3 +702,14 @@
$cfg51 = new Config::General( -ConfigFile => "t/cfg.51.out", -InterPolateVars => 1 );
my %hash51new = $cfg51->getall();
is_deeply(\%hash51, \%hash51new, "compare saved config containing escaped chars");
+
+
+# check if forced single value arrays remain
+my $cfg52 = new Config::General( -String => "habeas = [ corpus ]", -ForceArray => 1);
+my %hash52 = $cfg52->getall();
+my @array52 = qw(corpus);
+is_deeply($hash52{habeas}, \@array52, "check -ForceArray single value arrays");
+$cfg52->save_file("t/cfg.52.out");
+$cfg52 = new Config::General( -ConfigFile => "t/cfg.52.out", -ForceArray => 1);
+my %hash52new = $cfg52->getall();
+is_deeply(\%hash52new, \%hash52, "check -ForceArray single value arrays during save()");
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org