Hello community,
here is the log from the commit of package perl-Config-General for openSUSE:Factory
checked in at Mon Jan 11 18:08:41 CET 2010.
--------
--- perl-Config-General/perl-Config-General.changes 2009-07-07 09:35:08.000000000 +0200
+++ /mounts/work_src_done/STABLE/perl-Config-General/perl-Config-General.changes 2009-12-13 19:24:41.000000000 +0100
@@ -1,0 +2,33 @@
+Sun Dec 13 18:17:09 UTC 2009 - chris@computersalat.de
+
+- update to 2.44
+ - fixed rt.cpan.org#49023 by rolling back change in 2.43
+ in line 158, regarding GLOB support.
+- 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.
+ This will prevent future conflicts hopefully. In addition
+ it makes it possible to make it customizable, if neccessary,
+ in a future release.
+ - fixed rt.cpan.org#42721, return undef for empty values
+ - fixed rt.cpan.org#42331, return undef for empty objects
+ - fixed rt.cpan.org#44600, comments after blockname
+ causes parser failure.
+ - fixed rt.cpan.org#42287, whitespace at beginning or end
+ of a quoted value gets lost after save().
+ - fixed rt.cpan.org#46184, variables that were not previously
+ defined are deleted when -InterPolateEnv is enabled.
+ - fixed bug in config loader for FileHandle objects, it
+ supports now any compatible object. Hint by Ingo Schmiegel.
+ - applied spelling- and speedup patches by Ville Skyttä.
+ - applied documentation patch by Jordan Macdonald.
+- cleanup spec
+ * sort tags
+ * define cpan_name
+ * update url
+ * update desc / author
+- added perl-macros
+ * perl_gen_filelist
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
Config-General-2.42.tar.bz2
New:
----
Config-General-2.44.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Config-General.spec ++++++
--- /var/tmp/diff_new_pack.b7JiOf/_old 2010-01-11 18:08:19.000000000 +0100
+++ /var/tmp/diff_new_pack.b7JiOf/_new 2010-01-11 18:08:19.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package perl-Config-General (Version 2.42)
+# spec file for package perl-Config-General (Version 2.44)
#
-# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2010 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
@@ -19,61 +19,66 @@
Name: perl-Config-General
-%define module_name Config-General
+%define cpan_name %( echo %{name} | %{__sed} -e 's,perl-,,' )
Summary: Generic Config Module
-Version: 2.42
+Version: 2.44
Release: 1
-Requires: perl = %{perl_version}
-AutoReqProv: on
-License: Artistic License .. ; GPL v2 or later
+License: Artistic License .. ; GPLv2+
Group: Development/Libraries/Perl
-Source0: %{module_name}-%{version}.tar.bz2
-Url: http://search.cpan.org/perldoc?Config::General
+Url: http://search.cpan.org/dist/Config-General
+Source0: %{cpan_name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: perl
+BuildRequires: perl-macros
+Requires: perl = %{perl_version}
+Provides: %{cpan_name}
%description
-This module opens a config file and parses it's contents for you. The new
-method requires one parameter which needs to be a filename. The method getall
-returns a hash which contains all options and it's associated values of your
-config file.
-
-The format of config files supported by Config::General is inspired by the well
-known apache config format, in fact, this module is 100% compatible to apache
-configs, but you can also just use simple name/value pairs in your config
+This module opens a config file and parses it's contents
+for you. After parsing the module returns a hash structure
+which contains the representation of the config file.
+
+The format of config files supported by Config::General is
+inspired by the well known apache config format, in fact,
+this module is 100% read-compatible to apache configs, but
+you can also just use simple name/value pairs in your config
files.
-In addition to the capabilities of an apache config file it supports some
-enhancements such as here-documents, C-style comments or multiline options.
-
+In addition to the capabilities of a apache config file
+it supports some enhancements such as here-documents, C-
+style comments or multiline options. It is also possible to
+save the config back to disk, which makes the module a
+perfect backend for configuration interfaces.
+
+It is possible to use variables in config files and there
+exists also support for object oriented access to the
+configuration.
Authors:
--------
- Thomas Linden
+ Thomas Linden
%prep
-%setup -q -n %{module_name}-%{version}
+%setup -q -n %{cpan_name}-%{version}
%build
-CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL
-make %{?jobs:-j%jobs}
+perl Makefile.PL OPTIMIZE="$RPM_OPT_FLAGS -Wall"
+%{__make} %{?jobs:-j%jobs}
%check
-make test
+%{__make} test
%install
%perl_make_install
%perl_process_packlist
+%perl_gen_filelist
%clean
-rm -rf $RPM_BUILD_ROOT
+%{__rm} -rf $RPM_BUILD_ROOT
-%files
+%files -f %{name}.files
%defattr(-, root, root)
%doc Changelog README example.cfg
-%doc %{_mandir}/man?/*
-%{perl_vendorarch}/auto/Config
-%{perl_vendorlib}/Config
-/var/adm/perl-modules/%{name}
%changelog
++++++ Config-General-2.42.tar.bz2 -> Config-General-2.44.tar.bz2 ++++++
Files old/Config-General-2.42/._Changelog and new/Config-General-2.44/._Changelog differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.42/Changelog new/Config-General-2.44/Changelog
--- old/Config-General-2.42/Changelog 2008-12-18 13:15:14.000000000 +0100
+++ new/Config-General-2.44/Changelog 2009-09-07 20:51:44.000000000 +0200
@@ -1,3 +1,36 @@
+2.44
+ - fixed rt.cpan.org#49023 by rolling back change in 2.43
+ in line 158, regarding GLOB support.
+
+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.
+ This will prevent future conflicts hopefully. In addition
+ it makes it possible to make it customizable, if neccessary,
+ in a future release.
+
+ - fixed rt.cpan.org#42721, return undef for empty values
+
+ - fixed rt.cpan.org#42331, return undef for empty objects
+
+ - fixed rt.cpan.org#44600, comments after blockname
+ causes parser failure.
+
+ - fixed rt.cpan.org#42287, whitespace at beginning or end
+ of a quoted value gets lost after save().
+
+ - fixed rt.cpan.org#46184, variables that were not previously
+ defined are deleted when -InterPolateEnv is enabled.
+
+ - fixed bug in config loader for FileHandle objects, it
+ supports now any compatible object. Hint by Ingo Schmiegel.
+
+ - applied spelling- and speedup patches by Ville Skytt�.
+
+ - applied documentation patch by Jordan Macdonald.
+
+
2.42
- dist tarball for 2.41 missed t/Tie/LxHash.pm. Dammit.
the File to the MANIFEST.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.42/General/Extended.pm new/Config-General-2.44/General/Extended.pm
--- old/Config-General-2.42/General/Extended.pm 2008-12-17 22:09:37.000000000 +0100
+++ new/Config-General-2.44/General/Extended.pm 2009-07-15 20:16:13.000000000 +0200
@@ -315,7 +315,7 @@
}
else {
# be cool
- return "";
+ return undef; # bugfix rt.cpan.org#42331
}
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.42/General/Interpolated.pm new/Config-General-2.44/General/Interpolated.pm
--- old/Config-General-2.42/General/Interpolated.pm 2008-12-17 22:09:38.000000000 +0100
+++ new/Config-General-2.44/General/Interpolated.pm 2009-07-19 22:04:51.000000000 +0200
@@ -2,13 +2,13 @@
# Config::General::Interpolated - special Class based on Config::General
#
# Copyright (c) 2001 by Wei-Hon Chen .
-# Copyright (c) 2000-2007 by Thomas Linden .
+# Copyright (c) 2000-2009 by Thomas Linden .
# All Rights Reserved. Std. disclaimer applies.
# Artificial License, same as perl itself. Have fun.
#
package Config::General::Interpolated;
-$Config::General::Interpolated::VERSION = "2.10";
+$Config::General::Interpolated::VERSION = "2.11";
use strict;
use Carp;
@@ -124,6 +124,14 @@
#
my ($this, $config) = @_;
+ # bugfix rt.cpan.org#46184, moved code from _interpolate() to here.
+ if ($this->{InterPolateEnv} && defined(%ENV)) {
+ # may lead to vulnerabilities, by default flag turned off
+ for my $key (keys %ENV){
+ $config->{__stack}->{$key}=$ENV{$key};
+ }
+ }
+
$config = $this->_var_hash_stacker($config);
return $config;
@@ -253,7 +261,7 @@
=head1 DESCRIPTION
This is an internal module which makes it possible to interpolate
-perl style variables in your config file (i.e. C<$variable>
+Perl style variables in your config file (i.e. C<$variable>
or C<${variable}>).
Normally you don't call it directly.
@@ -313,7 +321,7 @@
Variables inside double quotes will be interpolated, but variables
inside single quotes will B<not> interpolated. This is the same
-behavior as you know of perl itself.
+behavior as you know of Perl itself.
In addition you can surround variable names with curly braces to
avoid misinterpretation by the parser.
@@ -331,7 +339,7 @@
=head1 COPYRIGHT
Copyright 2001 by Wei-Hon Chen E<lt>plasmaball@pchome.com.twE<gt>.
-Copyright 2002-2007 by Thomas Linden .
+Copyright 2002-2009 by Thomas Linden .
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
@@ -340,7 +348,7 @@
=head1 VERSION
-2.09
+2.11
=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.42/General.pm new/Config-General-2.44/General.pm
--- old/Config-General-2.42/General.pm 2008-12-18 13:02:59.000000000 +0100
+++ new/Config-General-2.44/General.pm 2009-09-07 20:49:55.000000000 +0200
@@ -5,7 +5,7 @@
# config values from a given file and
# return it as hash structure
#
-# Copyright (c) 2000-2008 Thomas Linden .
+# Copyright (c) 2000-2009 Thomas Linden .
# All Rights Reserved. Std. disclaimer applies.
# Artificial License, same as perl itself. Have fun.
#
@@ -32,7 +32,7 @@
use Carp;
use Exporter;
-$Config::General::VERSION = 2.42;
+$Config::General::VERSION = 2.44;
use vars qw(@ISA @EXPORT_OK);
use base qw(Exporter);
@@ -47,6 +47,11 @@
# define default options
my $self = {
+ # sha256 of current date
+ # hopefully this lowers the probability that
+ # this matches any configuration key or value out there
+ # bugfix for rt.40925
+ EOFseparator => 'ad7d7b87f5b81d2a0d5cb75294afeb91aa4801b1f8e8532dc1b633c0e1d47037',
SlashIsDirectory => 0,
AllowMultiOptions => 1,
MergeDuplicateOptions => 0,
@@ -453,7 +458,7 @@
}
if (!$found) {
my $path_message = defined $this->{ConfigPath} ? q( within ConfigPath: ) . join(q(.), @{$this->{ConfigPath}}) : q();
- croak qq{Config::GeneralThe file "$basefile" does not exist$path_message!};
+ croak qq{Config::General The file "$basefile" does not exist$path_message!};
}
}
@@ -581,7 +586,7 @@
# inside here-doc, only look for $hierend marker
if (/^(\s*)\Q$hierend\E\s*$/) {
my $indent = $1; # preserve indentation
- $hier .= ' ' . chr 182; # append a "�" to the here-doc-name, so
+ $hier .= ' ' . $this->{EOFseparator}; # bugfix of rt.40925
# _parse will also preserver indentation
if ($indent) {
foreach (@hierdoc) {
@@ -609,7 +614,7 @@
##
# Remove comments and empty lines
- s/(? .* bugfix rt.cpan.org#44600
next if /^\s*#/;
next if /^\s*$/;
@@ -754,21 +759,20 @@
my($this, $config, $content) = @_;
my(@newcontent, $block, $blockname, $chunk,$block_level);
local $_;
- my $indichar = chr 182; # �, inserted by _open, our here-doc indicator
foreach (@{$content}) { # loop over content stack
chomp;
$chunk++;
- $_ =~ s/^\s*//; # strip spaces @ end and begin
- $_ =~ s/\s*$//;
+ $_ =~ s/^\s+//; # strip spaces @ end and begin
+ $_ =~ s/\s+$//;
#
# build option value assignment, split current input
# using whitespace, equal sign or optionally here-doc
- # separator (ascii 182).
+ # separator EOFseparator
my ($option,$value);
- if (/$indichar/) {
- ($option,$value) = split /\s*$indichar\s*/, $_, 2; # separated by heredoc-finding in _open()
+ if (/$this->{EOFseparator}/) {
+ ($option,$value) = split /\s*$this->{EOFseparator}\s*/, $_, 2; # separated by heredoc-finding in _open()
}
else {
if ($this->{SplitPolicy} eq 'guess') {
@@ -1020,8 +1024,8 @@
# fixes rt.cpan.org bug #35122
my($this, $source) = @_;
my %hash = ();
- foreach my $key (keys %{$source}) {
- $hash{$key} = $source->{$key};
+ while (my ($key, $value) = each %{$source}) {
+ $hash{$key} = $value;
}
return \%hash;
}
@@ -1037,7 +1041,7 @@
# avoid "Use of uninitialized value"
if (! defined $value) {
- $value = q();
+ $value = undef; # bigfix rt.cpan.org#42721 q();
}
if ($this->{InterPolateVars}) {
@@ -1083,7 +1087,7 @@
# Since we do parsing from within new(), we must
# call it again if one turns NoMultiOptions on!
#
- croak q(Config::GeneralThe NoMultiOptions() method is deprecated. Set 'AllowMultiOptions' to 'no' instead!);
+ croak q(Config::Genera: lThe NoMultiOptions() method is deprecated. Set 'AllowMultiOptions' to 'no' instead!);
}
@@ -1103,7 +1107,7 @@
$this->save_file($one, \%h);
}
else {
- croak q(Config::GeneralThe save() method is deprecated. Use the new save_file() method instead!);
+ croak q(Config::General: The save() method is deprecated. Use the new save_file() method instead!);
}
return;
}
@@ -1272,6 +1276,11 @@
else {
# a simple stupid scalar entry
$line =~ s/#/\\#/g;
+ # bugfix rt.cpan.org#42287
+ if ($line =~ /^\s/ or $line =~ /\s$/) {
+ # need to quote it
+ $line = "\"$line\"";
+ }
$config_string .= $indent . $entry . $this->{StoreDelimiter} . $line . "\n";
}
@@ -1306,14 +1315,12 @@
# return a probably tied new empty hash ref
#
my($this) = @_;
- my ($package, $filename, $line, $subroutine, $hasargs,
- $wantarray, $evaltext, $is_require, $hints, $bitmask) = caller 0;
if ($this->{Tie}) {
eval {
eval qq{require $this->{Tie}};
};
if ($EVAL_ERROR) {
- croak q(Config::GeneralCould not create a tied hash of type: ) . $this->{Tie} . q(: ) . $EVAL_ERROR;
+ croak q(Config::General: Could not create a tied hash of type: ) . $this->{Tie} . q(: ) . $EVAL_ERROR;
}
my %hash;
tie %hash, $this->{Tie};
@@ -1343,11 +1350,11 @@
my ($file, $hash) = @_;
if (!$file || !$hash) {
- croak q{Config::GeneralSaveConfig(): filename and hash argument required.};
+ croak q{Config::General::SaveConfig(): filename and hash argument required.};
}
else {
if (ref($hash) ne 'HASH') {
- croak q(Config::GeneralThe second parameter must be a reference to a hash!);
+ croak q(Config::General::SaveConfig() The second parameter must be a reference to a hash!);
}
else {
(new Config::General(-ConfigHash => $hash))->save_file($file);
@@ -1364,11 +1371,11 @@
my ($hash) = @_;
if (!$hash) {
- croak q{Config::GeneralSaveConfigString(): Hash argument required.};
+ croak q{Config::General::SaveConfigString(): Hash argument required.};
}
else {
if (ref($hash) ne 'HASH') {
- croak q(Config::GeneralThe parameter must be a reference to a hash!);
+ croak q(Config::General::SaveConfigString() The parameter must be a reference to a hash!);
}
else {
return (new Config::General(-ConfigHash => $hash))->save_string();
@@ -1406,15 +1413,15 @@
=head1 DESCRIPTION
-This module opens a config file and parses it's contents for you. The B<new> method
+This module opens a config file and parses its contents for you. The B<new> method
requires one parameter which needs to be a filename. The method B<getall> returns a hash
-which contains all options and it's associated values of your config file.
+which contains all options and its associated values of your config file.
-The format of config files supported by BConfig::General is inspired by the well known apache config
-format, in fact, this module is 100% compatible to apache configs, but you can also just use simple
-name/value pairs in your config files.
+The format of config files supported by BConfig::General is inspired by the well known Apache config
+format, in fact, this module is 100% compatible to Apache configs, but you can also just use simple
+ name/value pairs in your config files.
-In addition to the capabilities of an apache config file it supports some enhancements such as here-documents,
+In addition to the capabilities of an Apache config file it supports some enhancements such as here-documents,
C-style comments or multiline options.
@@ -1487,7 +1494,7 @@
The default is "yes".
i.e.:
- -AllowMultiOptions => "no"
+ -AllowMultiOptions => "yes"
see B<IDENTICAL OPTIONS> for details.
@@ -1502,7 +1509,7 @@
=item B<-UseApacheInclude>
If set to a true value, the parser will consider "include ..." as valid include
-statement (just like the well known apache include statement).
+statement (just like the well known Apache include statement).
@@ -1580,7 +1587,7 @@
Setting this option implies B<-AllowMultiOptions == false> unless you set
B<-AllowMultiOptions> explicit to 'true'. In this case duplicate blocks are
-allowed and put into an array but dupclicate options will be merged.
+allowed and put into an array but duplicate options will be merged.
=item B<-AutoLaunder>
@@ -1658,7 +1665,7 @@
This method allows the user (or, the "maintainer" of the configfile for your
application) to set multiple pre-defined values for one option.
-Please beware, that all occurencies of those variables will be handled this
+Please beware, that all occurrences of those variables will be handled this
way, there is no way to distinguish between variables in different scopes.
That means, if "Mode" would also occur inside a named block, it would
also parsed this way.
@@ -1696,10 +1703,10 @@
B<-Tie> takes the name of a Tie class as argument that each new hash should be
based off of.
-This hash will be used as the 'backing hash' instead of a standard perl hash,
+This hash will be used as the 'backing hash' instead of a standard Perl hash,
which allows you to affect the way, variable storing will be done. You could, for
example supply a tied hash, say Tie::DxHash, which preserves ordering of the
-keys in the config (which a standard perl hash won't do). Or, you could supply
+keys in the config (which a standard Perl hash won't do). Or, you could supply
a hash tied to a DBM file to save the parsed variables to disk.
There are many more things to do in tie-land, see L<tie> to get some interesting
@@ -1726,7 +1733,7 @@
=item B<-InterPolateVars>
If set to a true value, variable interpolation will be done on your config
-input. See LConfig::General::Interpolated for more informations.
+input. See LConfig::General::Interpolated for more information.
=item B<-InterPolateEnv>
@@ -1743,7 +1750,7 @@
=item B<-StrictObjects>
By default this is turned on, which causes Config::General to croak with an
-error if you try to access a non-existent key using the oop-way (B<-ExtendedAcess>
+error if you try to access a non-existent key using the OOP-way (B<-ExtendedAcess>
enabled). If you turn B<-StrictObjects> off (by setting to 0 or "no") it will
just return an empty object/hash/scalar. This is valid for OOP-access 8via AUTOLOAD
and for the methods obj(), hash() and value().
@@ -1759,10 +1766,10 @@
You can influence the way how Config::General decides which part of a line
in a config file is the key and which one is the value. By default it tries
-it's best to guess. That means you can mix equalsign assignments and whitespace
+its best to guess. That means you can mix equalsign assignments and whitespace
assignments.
-However, somtimes you may wish to make it more strictly for some reason. In
+However, somtime you may wish to make it more strictly for some reason. In
this case you can set B<-SplitPolicy>. The possible values are: 'guess' which
is the default, 'whitespace' which causes the module to split by whitespace,
'equalsign' which causes it to split strictly by equal sign, or 'custom'. In the
@@ -1771,12 +1778,12 @@
-SplitDelimiter => '\s*:\s*'
-will cause the module to split by colon while whitespaces which surrounds
+will cause the module to split by colon while whitespace which surrounds
the delimiter will be removed.
Please note that the delimiter used when saving a config (save_file() or save_string())
-will be choosen accordingto the current B<-SplitPolicy>. If -SplitPolicy is
-set to 'guess' or 'whitespace', 3 whitespaces will be used to delimit saved
+will be chosen according to the current B<-SplitPolicy>. If -SplitPolicy is
+set to 'guess' or 'whitespace', 3 spaces will be used to delimit saved
options. If 'custom' is set, then you need to set B<-StoreDelimiter>.
=item B<-SplitDelimiter>
@@ -1790,7 +1797,7 @@
configs to a file or string. You only need to set it if you want to store
the config back to disk and if you have B<-SplitPolicy> set to 'custom'.
-Be very carefull with this parameter.
+Be very careful with this parameter.
=item B<-CComments>
@@ -1809,7 +1816,7 @@
By default it is turned off.
-Be carefull with this option, as it removes all backslashes after parsing.
+Be careful with this option, as it removes all backslashes after parsing.
B<This option might be removed in future versions>.
@@ -1819,7 +1826,7 @@
of a named block will be considered as a directory name.
By default this flag is turned off, which makes the module somewhat
-incompatible to apache configs, since such a setup will be normally
+incompatible to Apache configs, since such a setup will be normally
considered as an explicit empty block, just as XML defines it.
For example, if you have the following config:
@@ -1850,19 +1857,19 @@
case you may consider to turn on B<-SlashIsDirectory>.
Please note that this is a new option (incorporated in version 2.30),
-it may lead to various unexpected sideeffects or other failures.
+it may lead to various unexpected side effects or other failures.
You've been warned.
=item B<-ApacheCompatible>
Over the past years a lot of options has been incorporated
-into Config::General to be able to parse real apache configs.
+into Config::General to be able to parse real Apache configs.
The new B<-ApacheCompatible> option now makes it possible to
-tweak all options in a way that apache configs can be parsed.
+tweak all options in a way that Apache configs can be parsed.
This is called "apache compatibility mode" - if you will ever
-have problems with parsing apache configs without this option
+have problems with parsing Apache configs without this option
being set, you'll get no help by me. Thanks :)
The following options will be set:
@@ -1885,7 +1892,7 @@
=item B<-UTF8>
If turned on, all files will be opened in utf8 mode. This may
-not work properly with older versions of perl.
+not work properly with older versions of Perl.
=item B<-SaveSorted>
@@ -1907,14 +1914,14 @@
=item save_file()
-Writes the config hash back to the harddisk. This method takes one or two
+Writes the config hash back to the hard disk. This method takes one or two
parameters. The first parameter must be the filename where the config
should be written to. The second parameter is optional, it must be a
reference to a hash structure, if you set it. If you do not supply this second parameter
then the internal config hash, which has already been parsed, will be
used.
-Please note, that any occurence of comments will be ignored by getall()
+Please note that any occurence of comments will be ignored by getall()
and thus be lost after you call this method.
You need also to know that named blocks will be converted to nested blocks
@@ -1965,11 +1972,11 @@
=head1 CONFIG FILE FORMAT
-Lines begining with B<#> and empty lines will be ignored. (see section COMMENTS!)
-Spaces at the begining and the end of a line will also be ignored as well as tabulators.
-If you need spaces at the end or the beginning of a value you can use
-apostrophs B<">.
-An optionline starts with it's name followed by a value. An equalsign is optional.
+Lines beginning with B<#> and empty lines will be ignored. (see section COMMENTS!)
+Spaces at the beginning and the end of a line will also be ignored as well as tabulators.
+If you need spaces at the end or the beginning of a value you can surround it with
+double quotes.
+An option line starts with its name followed by a value. An equal sign is optional.
Some possible examples:
user max
@@ -1985,7 +1992,7 @@
=head1 BLOCKS
You can define a B<block> of options. A B<block> looks much like a block
-in the wellknown apache config format. It starts with E<lt>B<blockname>E<gt> and ends
+in the wellknown Apache config format. It starts with E<lt>B<blockname>E<gt> and ends
with E<lt>/B<blockname>E<gt>. An example:
<database>
@@ -2068,7 +2075,7 @@
Please note, that the above config block would result in a
valid hash structure, even if B<-LowerCaseNames> is not set!
This is because IConfig::General does not
-use the blocknames to check if a block ends, instead it uses an internal
+use the block names to check if a block ends, instead it uses an internal
state counter, which indicates a block end.
If the module cannot find an end-block statement, then this block will be ignored.
@@ -2078,7 +2085,7 @@
=head1 NAMED BLOCKS
If you need multiple blocks of the same name, then you have to name every block.
-This works much like apache config. If the module finds a named block, it will
+This works much like Apache config. If the module finds a named block, it will
create a hashref with the left part of the named block as the key containing
one or more hashrefs with the right part of the block as key containing everything
inside the block(which may again be nested!). As examples says more than words:
@@ -2111,12 +2118,12 @@
be stored in a hashref and therefore be overwritten if a block occurs once more.
-=head1 WHITESPACES IN BLOCKS
+=head1 WHITESPACE IN BLOCKS
-The normal behavior of Config::General is to look for whitespaces in
+The normal behavior of Config::General is to look for whitespace in
block names to decide if it's a named block or just a simple block.
-Sometimes you may need blocknames which have whitespaces in their names.
+Sometimes you may need blocknames which have whitespace in their names.
With named blocks this is no problem, as the module only looks for the
first whitespace:
@@ -2133,7 +2140,7 @@
}
};
-The problem occurs, if you want to have a simple block containing whitespaces:
+The problem occurs, if you want to have a simple block containing whitespace:
<hugo gera>
@@ -2148,7 +2155,7 @@
cases.
-=head1 EXPICIT EMPTY BLOCKS
+=head1 EXPLICIT EMPTY BLOCKS
Beside the notation of blocks mentioned above it is possible to use
explicit empty blocks.
@@ -2177,9 +2184,9 @@
log log2
log log2
-You will get a scalar if the option occured only once or an array if it occured
+You will get a scalar if the option occurred only once or an array if it occurred
more than once. If you expect multiple identical options, then you may need to
-check if an option occured more than once:
+check if an option occurred more than once:
$allowed = $hash{jonas}->{tablestructure}->{allowed};
if(ref($allowed) eq "ARRAY") {
@@ -2224,10 +2231,12 @@
$VAR1 = {
'dir' => {
- 'blah' => [
- 'user' => 'max',
- 'user' => 'hannes'
- ]
+ 'blah' => {
+ 'user' => [
+ 'max',
+ 'hannes'
+ ]
+ }
}
};
@@ -2238,7 +2247,7 @@
If you don't want to allow more than one identical options, you may turn it off
by setting the flag I<AllowMultiOptions> in the B method to "no".
-If turned off, Config::General will complain about multiple occuring options
+If turned off, Config::General will complain about multiple occurring options
with identical names!
@@ -2262,7 +2271,7 @@
=head1 HERE DOCUMENTS
You can also define a config value as a so called "here-document". You must tell
-the module an identifier which identicates the end of a here document. An
+the module an identifier which idicates the end of a here document. An
identifier must follow a "<<".
Example:
@@ -2277,7 +2286,7 @@
Everything between the two "EOF" strings will be in the option I<message>.
There is a special feature which allows you to use indentation with here documents.
-You can have any amount of whitespaces or tabulators in front of the end
+You can have any amount of whitespace or tabulators in front of the end
identifier. If the module finds spaces or tabs then it will remove exactly those
amount of spaces from every line inside the here-document.
@@ -2297,7 +2306,7 @@
homedir of
root.
-because there were the string " " in front of EOF, which were cutted from every
+because there were the string " " in front of EOF, which were cut from every
line inside the here-document.
@@ -2317,8 +2326,8 @@
This file will be inserted at the position where it was found as if the contents of this file
were directly at this position.
-You can also recurively include files, so an included file may include another one and so on.
-Beware that you do not recursively load the same file, you will end with an errormessage like
+You can also recursively include files, so an included file may include another one and so on.
+Beware that you do not recursively load the same file, you will end with an error message like
"too many open files in system!".
By default included files with a relative pathname will be opened from within the current
@@ -2339,7 +2348,7 @@
/etc/crypt.d/acl.cfg
The default behavior (if B<-IncludeRelative> is B<not> set!) will be to open just I,
-whereever it is, i.e. if you did a chdir("/usr/local/etc"), then Config::General will include:
+wherever it is, i.e. if you did a chdir("/usr/local/etc"), then Config::General will include:
/usr/local/etc/acl.cfg
@@ -2380,7 +2389,7 @@
=head1 COMMENTS
A comment starts with the number sign B<#>, there can be any number of spaces and/or
-tabstops in front of the #.
+tab stops in front of the #.
A comment can also occur after a config statement. Example:
@@ -2402,7 +2411,7 @@
end block, it will ignore the whole rest of the config file!
BNOTE: If you require the B<#> character (number sign) to remain in the option value, then
-you can use a backlsash in front of it, to escape it. Example:
+you can use a backslash in front of it, to escape it. Example:
bgcolor = \#ffffcc
@@ -2420,7 +2429,7 @@
=head1 VARIABLE INTERPOLATION
-You can use variables inside your configfiles if you like. To do
+You can use variables inside your config files if you like. To do
that you have to use the module BConfig::General::Interpolated,
which is supplied with the Config::General distribution.
@@ -2481,7 +2490,7 @@
=head1 SEE ALSO
-I recommend you to read the following documentations, which are supplied with perl:
+I recommend you to read the following documents, which are supplied with Perl:
perlreftut Perl references short introduction
perlref Perl references, the rest of the story
@@ -2493,7 +2502,7 @@
=head1 LICENSE AND COPYRIGHT
-Copyright (c) 2000-2007 Thomas Linden
+Copyright (c) 2000-2009 Thomas Linden
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
@@ -2508,13 +2517,13 @@
=head1 DIAGNOSTICS
-To debug Config::General use the perl debugger, see L<perldebug>.
+To debug Config::General use the Perl debugger, see L<perldebug>.
=head1 DEPENDENCIES
Config::General depends on the modules L<FileHandle>,
LFile::Spec::Functions, LFile::Glob, which all are
-shipped with perl.
+shipped with Perl.
=head1 AUTHOR
@@ -2522,7 +2531,7 @@
=head1 VERSION
-2.42
+2.44
=cut
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.42/t/cfg.16a new/Config-General-2.44/t/cfg.16a
--- old/Config-General-2.42/t/cfg.16a 1970-01-01 01:00:00.000000000 +0100
+++ new/Config-General-2.44/t/cfg.16a 2009-07-15 20:45:29.000000000 +0200
@@ -0,0 +1,3 @@
+<etc>
+ log = ${HOME}/log/logfile # use braces
+</etc>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.42/t/cfg.6 new/Config-General-2.44/t/cfg.6
--- old/Config-General-2.42/t/cfg.6 2008-12-17 22:09:32.000000000 +0100
+++ new/Config-General-2.44/t/cfg.6 2009-07-15 20:30:28.000000000 +0200
@@ -8,3 +8,6 @@
/* oneline C-style comment */
host = blah.blubber
</db>
+<foo> #
+bar = baz
+</foo>
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.42/t/cfg.8 new/Config-General-2.44/t/cfg.8
--- old/Config-General-2.42/t/cfg.8 2008-12-17 22:09:32.000000000 +0100
+++ new/Config-General-2.44/t/cfg.8 2009-07-15 20:37:36.000000000 +0200
@@ -33,3 +33,7 @@
<beta>
user2 max
</beta>
+
+quoted = "this one contains whitespace at the end "
+
+quotedwithquotes = " holy crap, it contains \"masked quotes\" and 'single quotes' "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Config-General-2.42/t/run.t new/Config-General-2.44/t/run.t
--- old/Config-General-2.42/t/run.t 2008-12-17 22:09:33.000000000 +0100
+++ new/Config-General-2.44/t/run.t 2009-07-15 20:49:11.000000000 +0200
@@ -8,7 +8,7 @@
use Data::Dumper;
-use Test::More tests => 50;
+use Test::More tests => 51;
#use Test::More qw(no_plan);
# ahem, we deliver the test code with a local copy of
@@ -123,6 +123,18 @@
fail("Testing variable interpolation");
}
+### 16.a
+# testing variable interpolation with %ENV use
+my $env = "/home/theunexistent";
+$ENV{HOME} = $env;
+my $conf16a = new Config::General(-ConfigFile => "t/cfg.16a", -InterPolateVars => 1, -InterPolateEnv => 1, -StrictVars => 0);
+my %h16a = $conf16a->getall();
+if($h16a{etc}->{log} eq "$env/log/logfile") {
+ pass("Testing environment variable interpolation");
+}
+else {
+ fail("Testing environment variable interpolation");
+}
### 17
@@ -291,7 +303,7 @@
);
my %h26 = $conf26->getall;
my %expected_h26 = (
- foo => { 0 => { 0 => '' } },
+ foo => { 0 => { 0 => undef } },
);
is_deeply(\%h26, \%expected_h26, "testing 0-values in block names");
@@ -405,7 +417,7 @@
-SplitDelimiter => '\s*::\s*'
);
my %expect35 = (
- 'var3 = gamma' => '',
+ 'var3 = gamma' => undef,
'var1' => 'alpha',
'var2' => 'beta'
);
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org