stas 2003/01/19 21:43:56
Modified: perl-framework/Apache-Test/lib/Apache TestConfigPerl.pm
Log:
- preparation for the new special (non-apache) tag
o remove only leading indent, not all spaces
o allow caseinsensitive special tags
Revision Changes Path
1.62 +13 -9
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm
Index: TestConfigPerl.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- TestConfigPerl.pm 16 Jan 2003 02:39:13 -0000 1.61
+++ TestConfigPerl.pm 20 Jan 2003 05:43:56 -0000 1.62
@@ -204,6 +204,8 @@
PerlSwitches PerlRequire PerlModule
};
+my %special_directives = map { ("<$_>" => "</$_>") } qw(base noautoconfig);
+
#test .pm's can have configuration after the __DATA__ token
sub add_module_config {
my($self, $module, $args) = @_;
@@ -228,21 +230,23 @@
next;
}
my($directive, $rest) = split /\s+/, $_, 2;
- $directives{$directive}++;
+ $directives{$directive}++ unless $directive =~ /^</;
$rest = '' unless defined $rest;
- if ($outside_container{$directive}) {
- $self->postamble($directive => $rest);
- }
- elsif ($directive eq '<Base>') {
- # <Base> and </Base> are removed
- my $end = "</Base>";
+
+ if (my $end_tag = $special_directives{lc $directive}) {
+ # special directives like <Base> and </Base> are removed
+ my $indent;
while (<$fh>) {
chomp;
- last if m:^\Q$end:;
+ last if m:^\Q$end_tag:i;
+ $indent = /^(\s+)/ ? $1 : '' unless defined $indent;
$self->replace;
- s/^\s*//; # align for base
+ s/^$indent//; # align for base
$self->postamble($_);
}
+ }
+ elsif ($outside_container{$directive}) {
+ $self->postamble($directive => $rest);
}
elsif ($directive =~ /IfModule/) {
$self->postamble($_);