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 1.25: - include statements are now case insensitive
- include statements may now also being used with - include statements may now also being used with
indentation(leading and following whitespaces are indentation(leading and following whitespaces are

View File

@@ -17,7 +17,7 @@ use FileHandle;
use strict; use strict;
use Carp; use Carp;
$Config::General::VERSION = "1.25"; $Config::General::VERSION = "1.26";
sub new { sub new {
# #
@@ -41,6 +41,11 @@ sub new {
$self->{NoMultiOptions} = 1; $self->{NoMultiOptions} = 1;
} }
} }
if (exists $conf{-String} ) {
if ($conf{-String}) {
$self->{StringContent} = $conf{-String};
}
}
if (exists $conf{-LowerCaseNames}) { if (exists $conf{-LowerCaseNames}) {
if ($conf{-LowerCaseNames}) { if ($conf{-LowerCaseNames}) {
$self->{LowerCaseNames} = 1; $self->{LowerCaseNames} = 1;
@@ -57,6 +62,11 @@ sub new {
$self->{UseApacheInclude} = 1; $self->{UseApacheInclude} = 1;
} }
} }
if (exists $conf{-MergeDuplicateBlocks}) {
if ($conf{-MergeDuplicateBlocks}) {
$self->{MergeDuplicateBlocks} = 1;
}
}
} }
elsif ($#param == 0) { elsif ($#param == 0) {
# use of the old style # use of the old style
@@ -69,11 +79,21 @@ sub new {
} }
# process as usual # 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 # initialize with given hash
$self->{config} = $configfile; $self->{config} = $configfile;
$self->{parsed} = 1; $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 { else {
# open the file and read the contents in # open the file and read the contents in
$self->{configfile} = $configfile; $self->{configfile} = $configfile;
@@ -99,22 +119,44 @@ sub getall {
sub _open { sub _open {
# #
# open the config file # open the config file
# and store it's contents in @content
# #
my($this, $configfile) = @_; my($this, $configfile) = @_;
my(@content, $c_comment, $longline, $hier, $hierend, @hierdoc);
local $_;
my $fh = new FileHandle; my $fh = new FileHandle;
if (-e $configfile) { if (-e $configfile) {
open $fh, "<$configfile" or croak "Could not open $configfile!($!)\n"; open $fh, "<$configfile" or croak "Could not open $configfile!($!)\n";
while (<$fh>) { $this->_read($fh);
chomp; }
else {
croak "The file \"$configfile\" does not exist!\n";
}
}
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>: # patch by "Manuel Valente" <manuel@ripe.net>:
if (!$hierend) { if (!$hierend) {
s/(?<!\\)#.+$//; # Remove comments s/(?<!\\)#.+$//; # Remove comments
@@ -194,11 +236,6 @@ sub _open {
} }
} }
} }
close $fh;
}
else {
croak "The file \"$configfile\" does not exist!\n";
}
return 1; return 1;
} }
@@ -280,6 +317,12 @@ sub _parse {
if ($this->{NoMultiOptions}) { if ($this->{NoMultiOptions}) {
croak "Named block \"<$block $blockname>\" occurs more than once (level: $this->{level}, chunk $chunk)!\n"; croak "Named block \"<$block $blockname>\" occurs more than once (level: $this->{level}, chunk $chunk)!\n";
} }
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 { # preserve existing data else { # preserve existing data
my $savevalue = $config->{$block}->{$blockname}; my $savevalue = $config->{$block}->{$blockname};
delete $config->{$block}->{$blockname}; delete $config->{$block}->{$blockname};
@@ -294,6 +337,7 @@ sub _parse {
$config->{$block}->{$blockname} = \@ar; $config->{$block}->{$blockname} = \@ar;
} }
} }
}
else { # the first occurence of this particular named block else { # the first occurence of this particular named block
$config->{$block}->{$blockname} = $this->_parse($config->{$block}->{$blockname}, \@newcontent); $config->{$block}->{$blockname} = $this->_parse($config->{$block}->{$blockname}, \@newcontent);
} }
@@ -303,6 +347,12 @@ sub _parse {
if ($this->{NoMultiOptions}) { if ($this->{NoMultiOptions}) {
croak "Block \"<$block>\" occurs more than once (level: $this->{level}, chunk $chunk)!\n"; croak "Block \"<$block>\" occurs more than once (level: $this->{level}, chunk $chunk)!\n";
} }
else {
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 { else {
my $savevalue = $config->{$block}; my $savevalue = $config->{$block};
delete $config->{$block}; delete $config->{$block};
@@ -317,6 +367,7 @@ sub _parse {
$config->{$block} = \@ar; $config->{$block} = \@ar;
} }
} }
}
else { else {
# the first occurence of this particular block # the first occurence of this particular block
$config->{$block} = $this->_parse($config->{$block}, \@newcontent); $config->{$block} = $this->_parse($config->{$block}, \@newcontent);
@@ -464,11 +515,16 @@ Possible ways to call B<new()>:
-LowerCaseNames => "yes", -LowerCaseNames => "yes",
-UseApacheInclude => 1, -UseApacheInclude => 1,
-IncludeRelative => 1, -IncludeRelative => 1,
-MergeDuplicateBlocks => 1,
); );
$conf = new Config::General( $conf = new Config::General( -hash => \%somehash );
-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. 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. 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: 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. -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 -AllowMultiOptions - if the value is "no", then multiple
identical options are disallowed. identical options are disallowed.
-LowerCaseNames - if true (1 or "yes") then all options found -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, will be opened from within the location of the configfile,
if the configfile has an absolute pathname (i.e. if the configfile has an absolute pathname (i.e.
"/etc/main.conf"). "/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() =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 As you can see, the two identical blocks are stored in a hash which contains
an array(-reference) of hashes. 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 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". by setting the flag I<AllowMutliOptions> in the B<new()> method to "no".
If turned off, Config::General will complain about multiple occuring options If turned off, Config::General will complain about multiple occuring options
@@ -929,7 +1011,7 @@ Thomas Linden <tom@daemon.de>
=head1 VERSION =head1 VERSION
1.24 1.26
=cut =cut

View File

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

2
README
View File

@@ -59,4 +59,4 @@ AUTHOR
VERSION 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> <cops>
<officer> <officer>
<gordon> <gordon>

2
t/test.cfg Normal file
View File

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