i 1.26: - added filehandle capability to -file.

- added -String parameter to new(), which allows
           one to supply the whole config as a string.
         - added -MergeDuplicateBlocks option, which causes
	   duplicate blocks to be merged.


git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@14 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
Thomas von Dein
2009-10-10 16:12:40 +00:00
parent dd1ed568a1
commit 60c541d1c0
7 changed files with 263 additions and 175 deletions

View File

@@ -1,3 +1,9 @@
1.26: - added filehandle capability to -file.
- added -String parameter to new(), which allows
one to supply the whole config as a string.
- added -MergeDuplicateBlocks option, which causes
duplicate blocks to be merged.
1.25: - include statements are now case insensitive
- include statements may now also being used with
indentation(leading and following whitespaces are

View File

@@ -17,7 +17,7 @@ use FileHandle;
use strict;
use Carp;
$Config::General::VERSION = "1.25";
$Config::General::VERSION = "1.26";
sub new {
#
@@ -41,6 +41,11 @@ sub new {
$self->{NoMultiOptions} = 1;
}
}
if (exists $conf{-String} ) {
if ($conf{-String}) {
$self->{StringContent} = $conf{-String};
}
}
if (exists $conf{-LowerCaseNames}) {
if ($conf{-LowerCaseNames}) {
$self->{LowerCaseNames} = 1;
@@ -57,6 +62,11 @@ sub new {
$self->{UseApacheInclude} = 1;
}
}
if (exists $conf{-MergeDuplicateBlocks}) {
if ($conf{-MergeDuplicateBlocks}) {
$self->{MergeDuplicateBlocks} = 1;
}
}
}
elsif ($#param == 0) {
# use of the old style
@@ -69,11 +79,21 @@ sub new {
}
# process as usual
if (ref($configfile) eq "HASH") {
if (exists $self->{StringContent}) {
# consider the supplied string as config file
$self->_read($self->{StringContent}, "SCALAR");
$self->{config} = $self->_parse({}, $self->{content});
}
elsif (ref($configfile) eq "HASH") {
# initialize with given hash
$self->{config} = $configfile;
$self->{parsed} = 1;
}
elsif (ref($configfile) eq "GLOB") {
# use the file the glob points to
$self->_read($configfile);
$self->{config} = $self->_parse({}, $self->{content});
}
else {
# open the file and read the contents in
$self->{configfile} = $configfile;
@@ -99,105 +119,122 @@ sub getall {
sub _open {
#
# open the config file
# and store it's contents in @content
#
my($this, $configfile) = @_;
my(@content, $c_comment, $longline, $hier, $hierend, @hierdoc);
local $_;
my $fh = new FileHandle;
if (-e $configfile) {
open $fh, "<$configfile" or croak "Could not open $configfile!($!)\n";
while (<$fh>) {
chomp;
$this->_read($fh);
}
else {
croak "The file \"$configfile\" does not exist!\n";
}
}
# patch by "Manuel Valente" <manuel@ripe.net>:
if (!$hierend) {
s/(?<!\\)#.+$//; # Remove comments
next if /^#/; # Remove lines beginning with "#"
next if /^\s*$/; # Skip empty lines
s/\\#/#/g; # remove the \ char in front of masked "#"
}
if (/^\s*(\S+?)(\s*=\s*|\s+)<<(.+?)$/) { # we are @ the beginning of a here-doc
$hier = $1; # $hier is the actual here-doc
$hierend = $3; # the here-doc end string, i.e. "EOF"
}
elsif (defined $hierend && /^(\s*)\Q$hierend\E$/) { # the current here-doc ends here
my $indent = $1; # preserve indentation
$hier .= " " . chr(182); # append a "<22>" to the here-doc-name, so _parse will also preserver indentation
if ($indent) {
foreach (@hierdoc) {
s/^$indent//; # i.e. the end was: " EOF" then we remove " " from every here-doc line
$hier .= $_ . "\n"; # and store it in $hier
}
}
else {
$hier .= join "\n", @hierdoc; # there was no indentation of the end-string, so join it 1:1
}
push @{$this->{content}}, $hier; # push it onto the content stack
@hierdoc = ();
undef $hier;
undef $hierend;
}
elsif (/^\s*\/\*/) { # the beginning of a C-comment ("/*"), from now on ignore everything.
if (/\*\/\s*$/) { # C-comment end is already there, so just ignore this line!
$c_comment = 0;
}
else {
$c_comment = 1;
sub _read {
#
# store the config contents in @content
#
my($this, $fh, $flag) = @_;
my(@stuff, @content, $c_comment, $longline, $hier, $hierend, @hierdoc);
local $_;
if ($flag eq "SCALAR") {
if (ref($fh) eq "ARRAY") {
@stuff = @{$fh};
}
else {
@stuff = join "\n", $fh;
}
}
else {
@stuff = <$fh>;
}
foreach (@stuff) {
chomp;
# patch by "Manuel Valente" <manuel@ripe.net>:
if (!$hierend) {
s/(?<!\\)#.+$//; # Remove comments
next if /^#/; # Remove lines beginning with "#"
next if /^\s*$/; # Skip empty lines
s/\\#/#/g; # remove the \ char in front of masked "#"
}
if (/^\s*(\S+?)(\s*=\s*|\s+)<<(.+?)$/) { # we are @ the beginning of a here-doc
$hier = $1; # $hier is the actual here-doc
$hierend = $3; # the here-doc end string, i.e. "EOF"
}
elsif (defined $hierend && /^(\s*)\Q$hierend\E$/) { # the current here-doc ends here
my $indent = $1; # preserve indentation
$hier .= " " . chr(182); # append a "<22>" to the here-doc-name, so _parse will also preserver indentation
if ($indent) {
foreach (@hierdoc) {
s/^$indent//; # i.e. the end was: " EOF" then we remove " " from every here-doc line
$hier .= $_ . "\n"; # and store it in $hier
}
}
elsif (/\*\//) {
if (!$c_comment) {
warn "invalid syntax: found end of C-comment without previous start!\n";
}
$c_comment = 0; # the current C-comment ends here, go on
else {
$hier .= join "\n", @hierdoc; # there was no indentation of the end-string, so join it 1:1
}
elsif (/\\$/) { # a multiline option, indicated by a trailing backslash
chop;
push @{$this->{content}}, $hier; # push it onto the content stack
@hierdoc = ();
undef $hier;
undef $hierend;
}
elsif (/^\s*\/\*/) { # the beginning of a C-comment ("/*"), from now on ignore everything.
if (/\*\/\s*$/) { # C-comment end is already there, so just ignore this line!
$c_comment = 0;
}
else {
$c_comment = 1;
}
}
elsif (/\*\//) {
if (!$c_comment) {
warn "invalid syntax: found end of C-comment without previous start!\n";
}
$c_comment = 0; # the current C-comment ends here, go on
}
elsif (/\\$/) { # a multiline option, indicated by a trailing backslash
chop;
s/^\s*//;
$longline .= $_ if(!$c_comment); # store in $longline
}
else { # any "normal" config lines
if ($longline) { # previous stuff was a longline and this is the last line of the longline
s/^\s*//;
$longline .= $_ if(!$c_comment); # store in $longline
$longline .= $_ if(!$c_comment);
push @{$this->{content}}, $longline; # push it onto the content stack
undef $longline;
}
else { # any "normal" config lines
if ($longline) { # previous stuff was a longline and this is the last line of the longline
s/^\s*//;
$longline .= $_ if(!$c_comment);
push @{$this->{content}}, $longline; # push it onto the content stack
undef $longline;
}
elsif ($hier) { # we are inside a here-doc
push @hierdoc, $_; # push onto here-dco stack
}
else {
# look for include statement(s)
if (!$c_comment) {
my $incl_file;
if (/^\s*<<include (.+?)>>\s*$/i || (/^\s*include (.+?)\s*$/i && $this->{UseApacheInclude})) {
$incl_file = $1;
if ($this->{IncludeRelative} && $this->{configpath} && $incl_file !~ /^\//) {
# include the file from within location of $this->{configfile}
$this->_open($this->{configpath} . "/" . $incl_file);
}
else {
# include the file from within pwd, or absolute
$this->_open($incl_file);
}
elsif ($hier) { # we are inside a here-doc
push @hierdoc, $_; # push onto here-dco stack
}
else {
# look for include statement(s)
if (!$c_comment) {
my $incl_file;
if (/^\s*<<include (.+?)>>\s*$/i || (/^\s*include (.+?)\s*$/i && $this->{UseApacheInclude})) {
$incl_file = $1;
if ($this->{IncludeRelative} && $this->{configpath} && $incl_file !~ /^\//) {
# include the file from within location of $this->{configfile}
$this->_open($this->{configpath} . "/" . $incl_file);
}
else {
push @{$this->{content}}, $_;
}
# include the file from within pwd, or absolute
$this->_open($incl_file);
}
}
else {
push @{$this->{content}}, $_;
}
}
}
}
close $fh;
}
else {
croak "The file \"$configfile\" does not exist!\n";
}
return 1;
}
@@ -280,18 +317,25 @@ sub _parse {
if ($this->{NoMultiOptions}) {
croak "Named block \"<$block $blockname>\" occurs more than once (level: $this->{level}, chunk $chunk)!\n";
}
else { # preserve existing data
my $savevalue = $config->{$block}->{$blockname};
delete $config->{$block}->{$blockname};
my @ar;
if (ref $savevalue eq "ARRAY") {
push @ar, @{$savevalue}; # preserve array if any
else {
if ($this->{MergeDuplicateBlocks}) {
# just merge the new block with the same name as an existing one into
# this one.
$config->{$block}->{$blockname} = $this->_parse($config->{$block}->{$blockname}, \@newcontent);
}
else {
push @ar, $savevalue;
else { # preserve existing data
my $savevalue = $config->{$block}->{$blockname};
delete $config->{$block}->{$blockname};
my @ar;
if (ref $savevalue eq "ARRAY") {
push @ar, @{$savevalue}; # preserve array if any
}
else {
push @ar, $savevalue;
}
push @ar, $this->_parse( {}, \@newcontent); # append it
$config->{$block}->{$blockname} = \@ar;
}
push @ar, $this->_parse( {}, \@newcontent); # append it
$config->{$block}->{$blockname} = \@ar;
}
}
else { # the first occurence of this particular named block
@@ -304,17 +348,24 @@ sub _parse {
croak "Block \"<$block>\" occurs more than once (level: $this->{level}, chunk $chunk)!\n";
}
else {
my $savevalue = $config->{$block};
delete $config->{$block};
my @ar;
if (ref $savevalue eq "ARRAY") {
push @ar, @{$savevalue};
if ($this->{MergeDuplicateBlocks}) {
# just merge the new block with the same name as an existing one into
# this one.
$config->{$block} = $this->_parse($config->{$block}, \@newcontent);
}
else {
push @ar, $savevalue;
my $savevalue = $config->{$block};
delete $config->{$block};
my @ar;
if (ref $savevalue eq "ARRAY") {
push @ar, @{$savevalue};
}
else {
push @ar, $savevalue;
}
push @ar, $this->_parse( {}, \@newcontent);
$config->{$block} = \@ar;
}
push @ar, $this->_parse( {}, \@newcontent);
$config->{$block} = \@ar;
}
}
else {
@@ -459,16 +510,21 @@ Possible ways to call B<new()>:
$conf = new Config::General(\%somehash);
$conf = new Config::General(
-file => "rcfile",
-AllowMultiOptions => "no",
-LowerCaseNames => "yes",
-UseApacheInclude => 1,
-IncludeRelative => 1,
-file => "rcfile",
-AllowMultiOptions => "no",
-LowerCaseNames => "yes",
-UseApacheInclude => 1,
-IncludeRelative => 1,
-MergeDuplicateBlocks => 1,
);
$conf = new Config::General(
-hash => \%somehash,
);
$conf = new Config::General( -hash => \%somehash );
$conf = new Config::General( -String => $complete_config );
$conf = new Config::General( -String => \@config_lines );
$conf = new Config::General( -file => \*FD );
This method returns a B<Config::General> object (a hash blessed into "Config::General" namespace.
All further methods must be used from that returned object. see below.
@@ -482,8 +538,10 @@ still supported. Possible parameters are:
or a hash with one or more of the following keys set:
-file - a filename.
-file - a filename or a filehandle
-hash - a hash reference.
-String - a string which contains a whole config, or an arrayref
containing the whole config line by line.
-AllowMultiOptions - if the value is "no", then multiple
identical options are disallowed.
-LowerCaseNames - if true (1 or "yes") then all options found
@@ -495,6 +553,11 @@ still supported. Possible parameters are:
will be opened from within the location of the configfile,
if the configfile has an absolute pathname (i.e.
"/etc/main.conf").
-MergeDuplicateBlocks - the default behavior of Config::General is to create an
array if some junk in a config appears more than once. If
you turn this option on (set it to 1), then duplicate blocks,
that means blocks and named blocks will be merged into
a single one (see below for more details on this).
=item NoMultiOptions()
@@ -743,6 +806,25 @@ then you would end up with a data structure like this:
As you can see, the two identical blocks are stored in a hash which contains
an array(-reference) of hashes.
Under some rare conditions you might not want this behavior with blocks (and
named blocks too). If you want to get one single hash with the contents of
both identical blocks, then you need to turn the B<new()> parameter B<-MergeDuplicateBlocks>
on (see above). The parsed structure of the example above would then look like
this:
$VAR1 = {
'dir' => {
'blah' => [
'user' => 'max',
'user' => 'hannes'
]
}
};
As you can see, there is only one hash "dir->{blah}" containing multiple
"user" entries. As you can also see, turning on B<-MergeDuplicateBlocks>
does not affect scalar options (i.e. "option = value").
If you don't want to allow more than one identical options, you may turn it off
by setting the flag I<AllowMutliOptions> in the B<new()> method to "no".
If turned off, Config::General will complain about multiple occuring options
@@ -929,7 +1011,7 @@ Thomas Linden <tom@daemon.de>
=head1 VERSION
1.24
1.26
=cut

View File

@@ -1,7 +1,7 @@
# This Makefile is for the Config::General extension to perl.
#
# It was generated automatically by MakeMaker version
# 5.45 (Revision: 1.222) from the contents of
# 5.4302 (Revision: 1.222) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
@@ -18,27 +18,26 @@
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /usr/lib/perl5/5.6.0/i386-linux/Config.pm)
# These definitions are from config.sh (via /usr/libdata/perl/5.00503/mach/Config.pm)
# They may have been overridden via Makefile.PL or on the command line
AR = ar
CC = gcc
CCCDLFLAGS = -fPIC
CCDLFLAGS = -rdynamic
CC = cc
CCCDLFLAGS = -DPIC -fpic
CCDLFLAGS = -Wl,-R/usr/lib
DLEXT = so
DLSRC = dl_dlopen.xs
LD = gcc
LDDLFLAGS = -shared -L/usr/local/lib
LDFLAGS = -L/usr/local/lib
LIBC = /lib/libc-2.1.92.so
LD = cc
LDDLFLAGS = -Wl,-E -shared -lperl -lm
LDFLAGS = -Wl,-E -lperl -lm
LIBC =
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = linux
OSVERS = 2.2.5-22smp
OSNAME = freebsd
OSVERS = 4.0-current
RANLIB = :
SO = so
EXE_EXT =
FULL_AR = /usr/bin/ar
# --- MakeMaker constants section:
@@ -46,9 +45,9 @@ AR_STATIC_ARGS = cr
NAME = Config::General
DISTNAME = Config-General
NAME_SYM = Config_General
VERSION = 1.20
VERSION_SYM = 1_20
XS_VERSION = 1.20
VERSION = 1.25
VERSION_SYM = 1_25
XS_VERSION = 1.25
INST_BIN = blib/bin
INST_EXE = blib/script
INST_LIB = blib/lib
@@ -56,33 +55,31 @@ INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
PREFIX = /usr
INSTALLDIRS = site
INSTALLPRIVLIB = $(PREFIX)/lib/perl5/5.6.0
INSTALLARCHLIB = $(PREFIX)/lib/perl5/5.6.0/i386-linux
INSTALLSITELIB = $(PREFIX)/lib/perl5/site_perl/5.6.0
INSTALLSITEARCH = $(PREFIX)/lib/perl5/site_perl/5.6.0/i386-linux
INSTALLPRIVLIB = /usr/libdata/perl/5.00503
INSTALLARCHLIB = /usr/libdata/perl/5.00503/mach
INSTALLSITELIB = /usr/local/lib/perl5/site_perl/5.005
INSTALLSITEARCH = /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
INSTALLBIN = $(PREFIX)/bin
INSTALLSCRIPT = $(PREFIX)/bin
PERL_LIB = /usr/lib/perl5/5.6.0
PERL_ARCHLIB = /usr/lib/perl5/5.6.0/i386-linux
SITELIBEXP = /usr/lib/perl5/site_perl/5.6.0
SITEARCHEXP = /usr/lib/perl5/site_perl/5.6.0/i386-linux
PERL_LIB = /usr/libdata/perl/5.00503
PERL_ARCHLIB = /usr/libdata/perl/5.00503/mach
SITELIBEXP = /usr/local/lib/perl5/site_perl/5.005
SITEARCHEXP = /usr/local/lib/perl5/site_perl/5.005/i386-freebsd
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /usr/lib/perl5/5.6.0/i386-linux/CORE
PERL_INC = /usr/libdata/perl/5.00503/mach/CORE
PERL = /usr/bin/perl
FULLPERL = /usr/bin/perl
FULL_AR = /usr/bin/ar
VERSION_MACRO = VERSION
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
MAKEMAKER = /usr/lib/perl5/5.6.0/ExtUtils/MakeMaker.pm
MM_VERSION = 5.45
MAKEMAKER = /usr/libdata/perl/5.00503/ExtUtils/MakeMaker.pm
MM_VERSION = 5.4302
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
@@ -103,17 +100,15 @@ XS_FILES=
C_FILES =
O_FILES =
H_FILES =
HTMLLIBPODS =
HTMLSCRIPTPODS =
MAN1PODS =
MAN3PODS = General.pm
HTMLEXT = html
MAN3PODS = General.pm \
General/Extended.pm
INST_MAN1DIR = blib/man1
INSTALLMAN1DIR = $(PREFIX)/share/man/man1
INSTALLMAN1DIR = /usr/local/man/man1
MAN1EXT = 1
INST_MAN3DIR = blib/man3
INSTALLMAN3DIR = $(PREFIX)/share/man/man3
MAN3EXT = 3pm
INSTALLMAN3DIR = /usr/local/lib/perl5/5.00503/man/man3
MAN3EXT = 3
PERM_RW = 644
PERM_RWX = 755
@@ -148,9 +143,12 @@ EXPORT_LIST =
PERL_ARCHIVE =
TO_INST_PM = General.pm
TO_INST_PM = General.pm \
General/Extended.pm
PM_TO_BLIB = General.pm \
PM_TO_BLIB = General/Extended.pm \
$(INST_LIBDIR)/General/Extended.pm \
General.pm \
$(INST_LIBDIR)/General.pm
@@ -168,7 +166,7 @@ AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;au
SHELL = /bin/sh
CHMOD = chmod
CP = cp
LD = gcc
LD = cc
MV = mv
NOOP = $(SHELL) -c true
RM_F = rm -f
@@ -272,7 +270,7 @@ PASTHRU = LIB="$(LIB)"\
#all :: config $(INST_PM) subdirs linkext manifypods
all :: pure_all htmlifypods manifypods
all :: pure_all manifypods
@$(NOOP)
pure_all :: config pm_to_blib subdirs linkext
@@ -290,21 +288,25 @@ config :: $(INST_ARCHAUTODIR)/.exists
config :: $(INST_AUTODIR)/.exists
@$(NOOP)
$(INST_AUTODIR)/.exists :: /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h
config :: Version_check
@$(NOOP)
$(INST_AUTODIR)/.exists :: /usr/libdata/perl/5.00503/mach/CORE/perl.h
@$(MKPATH) $(INST_AUTODIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h $(INST_AUTODIR)/.exists
@$(EQUALIZE_TIMESTAMP) /usr/libdata/perl/5.00503/mach/CORE/perl.h $(INST_AUTODIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_AUTODIR)
$(INST_LIBDIR)/.exists :: /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h
$(INST_LIBDIR)/.exists :: /usr/libdata/perl/5.00503/mach/CORE/perl.h
@$(MKPATH) $(INST_LIBDIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h $(INST_LIBDIR)/.exists
@$(EQUALIZE_TIMESTAMP) /usr/libdata/perl/5.00503/mach/CORE/perl.h $(INST_LIBDIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_LIBDIR)
$(INST_ARCHAUTODIR)/.exists :: /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h
$(INST_ARCHAUTODIR)/.exists :: /usr/libdata/perl/5.00503/mach/CORE/perl.h
@$(MKPATH) $(INST_ARCHAUTODIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h $(INST_ARCHAUTODIR)/.exists
@$(EQUALIZE_TIMESTAMP) /usr/libdata/perl/5.00503/mach/CORE/perl.h $(INST_ARCHAUTODIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR)
@@ -312,9 +314,9 @@ config :: $(INST_MAN3DIR)/.exists
@$(NOOP)
$(INST_MAN3DIR)/.exists :: /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h
$(INST_MAN3DIR)/.exists :: /usr/libdata/perl/5.00503/mach/CORE/perl.h
@$(MKPATH) $(INST_MAN3DIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h $(INST_MAN3DIR)/.exists
@$(EQUALIZE_TIMESTAMP) /usr/libdata/perl/5.00503/mach/CORE/perl.h $(INST_MAN3DIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_MAN3DIR)
@@ -365,12 +367,6 @@ static :: Makefile $(INST_STATIC)
# --- MakeMaker static_lib section:
# --- MakeMaker htmlifypods section:
htmlifypods : pure_all
@$(NOOP)
# --- MakeMaker manifypods section:
POD2MAN_EXE = /usr/bin/pod2man
POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \
@@ -379,10 +375,13 @@ POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \
-e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\047t install $$m{$$_}\n";' \
-e 'chmod(oct($(PERM_RW))), $$m{$$_} or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}'
manifypods : pure_all General.pm
manifypods : pure_all General.pm \
General/Extended.pm
@$(POD2MAN) \
General.pm \
$(INST_MAN3DIR)/Config::General.$(MAN3EXT)
$(INST_MAN3DIR)/Config::General.$(MAN3EXT) \
General/Extended.pm \
$(INST_MAN3DIR)/Config::General::Extended.$(MAN3EXT)
# --- MakeMaker processPL section:
@@ -400,7 +399,7 @@ manifypods : pure_all General.pm
# the Makefile here so a later make realclean still has a makefile to use.
clean ::
-rm -rf ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c mon.out core core.*perl.*.? *perl.core so_locations pm_to_blib *~ */*~ */*/*~ *$(OBJ_EXT) *$(LIB_EXT) perl.exe $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def $(BASEEXT).exp
-rm -rf ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c mon.out core so_locations pm_to_blib *~ */*~ */*/*~ *$(OBJ_EXT) *$(LIB_EXT) perl.exe $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def $(BASEEXT).exp
-mv Makefile Makefile.old $(DEV_NULL)
@@ -409,7 +408,7 @@ clean ::
# Delete temporary files (via clean) and also delete installed files
realclean purge :: clean
rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR)
rm -f $(INST_LIBDIR)/General.pm
rm -f $(INST_LIBDIR)/General/Extended.pm $(INST_LIBDIR)/General.pm
rm -rf Makefile Makefile.old
@@ -521,8 +520,6 @@ pure_perl_install ::
$(INST_ARCHLIB) $(INSTALLARCHLIB) \
$(INST_BIN) $(INSTALLBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_HTMLLIBDIR) $(INSTALLHTMLPRIVLIBDIR) \
$(INST_HTMLSCRIPTDIR) $(INSTALLHTMLSCRIPTDIR) \
$(INST_MAN1DIR) $(INSTALLMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLMAN3DIR)
@$(WARN_IF_OLD_PACKLIST) \
@@ -537,15 +534,12 @@ pure_site_install ::
$(INST_ARCHLIB) $(INSTALLSITEARCH) \
$(INST_BIN) $(INSTALLBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_HTMLLIBDIR) $(INSTALLHTMLSITELIBDIR) \
$(INST_HTMLSCRIPTDIR) $(INSTALLHTMLSCRIPTDIR) \
$(INST_MAN1DIR) $(INSTALLMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLMAN3DIR)
@$(WARN_IF_OLD_PACKLIST) \
$(PERL_ARCHLIB)/auto/$(FULLEXT)
doc_perl_install ::
-@$(MKPATH) $(INSTALLARCHLIB)
-@$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLPRIVLIB)" \
@@ -555,7 +549,6 @@ doc_perl_install ::
>> $(INSTALLARCHLIB)/perllocal.pod
doc_site_install ::
-@$(MKPATH) $(INSTALLARCHLIB)
-@$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLSITELIB)" \
@@ -648,7 +641,7 @@ testdb_static :: testdb_dynamic
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
@$(PERL) -e "print qq{<SOFTPKG NAME=\"Config-General\" VERSION=\"1,20,0,0\">\n}. qq{\t<TITLE>Config-General</TITLE>\n}. qq{\t<ABSTRACT></ABSTRACT>\n}. qq{\t<AUTHOR></AUTHOR>\n}. qq{\t<IMPLEMENTATION>\n}. qq{\t\t<OS NAME=\"$(OSNAME)\" />\n}. qq{\t\t<ARCHITECTURE NAME=\"i386-linux\" />\n}. qq{\t\t<CODEBASE HREF=\"\" />\n}. qq{\t</IMPLEMENTATION>\n}. qq{</SOFTPKG>\n}" > Config-General.ppd
@$(PERL) -e "print qq{<SOFTPKG NAME=\"Config-General\" VERSION=\"1,25,0,0\">\n}. qq{\t<TITLE>Config-General</TITLE>\n}. qq{\t<ABSTRACT></ABSTRACT>\n}. qq{\t<AUTHOR></AUTHOR>\n}. qq{\t<IMPLEMENTATION>\n}. qq{\t\t<OS NAME=\"$(OSNAME)\" />\n}. qq{\t\t<ARCHITECTURE NAME=\"i386-freebsd\" />\n}. qq{\t\t<CODEBASE HREF=\"\" />\n}. qq{\t</IMPLEMENTATION>\n}. qq{</SOFTPKG>\n}" > Config-General.ppd
# --- MakeMaker pm_to_blib section:

2
README
View File

@@ -59,4 +59,4 @@ AUTHOR
VERSION
1.25
1.26

5
TODO Normal file
View File

@@ -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

View File

@@ -1,4 +1,4 @@
command ssh -f -g orphues.0x49.org -l azrael -L:34777samir.okir.da.ru:22 -L:31773:shane.sol1.rocket.de:22 'exec sleep 99999990'
command ssh -f -g orpheus.0x49.org -l azrael -L:34777samir.okir.da.ru:22 -L:31773:shane.sol1.rocket.de:22 'exec sleep 99999990'
<cops>
<officer>
<gordon>

2
t/test.cfg Normal file
View File

@@ -0,0 +1,2 @@
name Meier
prename Max