Skip Menu |

This queue is for tickets about the Config-ApacheFormat CPAN distribution.

Report information
The Basics
Id: 7537
Status: new
Priority: 0/
Queue: Config-ApacheFormat

People
Owner: Nobody in particular
Requestors: perl [...] kri.st
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Include in apache config file gails when the wildcards are used.
When Config::ApacheFormat is used to parse an apache config file that contains "include" directives with wildcards it fails. For example: Consider an apache config file that contains the following directive: Include conf/modules.d/*.conf And consider the following script: #!/usr/bin/perl use Config::ApacheFormat; $config = Config::ApacheFormat->new( root_directive => 'ServerRoot', hash_directives => [ 'AddHandler' ], include_directives => [ 'Include', 'AccessConfig', 'ResourceConfig' ], duplicate_directives => 'combine', setenv_vars => 1, fix_booleans => 1); $configfile= "/etc/apache2/conf/apache2.conf"; $config->read($configfile); # end script This script fails with the following error: Unable to open include file '/etc/apache2/conf/modules.d/*.conf' at /etc/apache2/conf/apache2.conf line 89: No such file or directory at ./apacheconf line 17 I've looked at the source, and found out that this is due to the fact that the module does not apply wildcard expansion to the value of the Include driective, as it should. HAving wildcards in the value of an include directive is allowed in apache config files, and is even incouraged in lieu of using a directory as value. I managed to solve the problem by adding a few lines to the ApacheFormat.pm file. Here is a diff: *** ApacheFormat.pm Wed Sep 1 15:57:03 2004 --- ApacheFormat.pm.new Wed Sep 1 15:59:22 2004 *************** *** 579,584 **** --- 579,589 ---- # Include processing # because of the way our inheritance works, we navigate multiple files in reverse if ($name =~ /$include_re/) { + # use glob to deal with possible wildcards in filenames + for (my $i=@val ; $i ; $i--) { + push @val, glob shift @val; + } + for my $f (reverse @val) { # if they specified a root_directive (ServerRoot) and # it is defined, prefix that to relative paths This small change solved the problem, at least for me.