Permalink
Browse files

Handle IncludeOptional directives.

When probing Apache 2 installs, that is. Resolves #53.
  • Loading branch information...
theory committed Aug 26, 2014
1 parent 23f207a commit f10626c0edd563b6a2aec7a76fca9be847c37558
Showing with 17 additions and 6 deletions.
  1. +11 −6 inst/htprobe_apache2.pl
  2. +6 −0 lib/Bric/Changes.pod
View
@@ -109,16 +109,21 @@ sub read_conf {
# Read in any included configuration files.
# (note: this is wrong in htprobe_apache.pl, where I left it alone.)
my $included = '';
while ($AP{conf} =~ /^\s*Include\s+(.+)$/gim) {
$included .= "\n" . slurp_conf(
file_name_is_absolute($1)
? $1
: rel2abs($1, $AP{HTTPD_ROOT})
);
while ($AP{conf} =~ /^\s*Include(?:Optional)?\s+(.+)$/gim) {
for my $file ( _include_files($1) ) {
$included .= "\n" . slurp_conf($file);
}
}
$AP{conf} .= $included;
}
sub _include_files {
my $base = shift;
$base = rel2abs($base, $AP{HTTPD_ROOT}) unless file_name_is_absolute($base);
return $base if -f $base;
return glob -d $base ? catfile($base, '*') : $base;
}
sub slurp_conf {
my $file = shift;
my @files = ();
View
@@ -186,6 +186,12 @@ Fix for the possibility that a FTP server would return a list, not a text messag
reported in L<this thread|http://www.gossamer-threads.com/lists/bricolage/users/40893>.
[Phillip Smith]
=item *
The installer now recognizes and handles C<IncludeOptional> directives when
loading the Apache configuration to probe. Thanks to GitHub user C<@streaps>
for the report! [David]
=back
=head1 Version 2.0.1 ()

0 comments on commit f10626c

Please sign in to comment.