From 583c18b5eb69ded5c534350d7fff0d7c77f54394 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 31 Oct 2010 14:18:43 -0700 Subject: [PATCH] Handle case where a LoadModule is inside an IfModule block --- apache/apache-lib.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apache/apache-lib.pl b/apache/apache-lib.pl index e1a06ddd2..e194ee98c 100755 --- a/apache/apache-lib.pl +++ b/apache/apache-lib.pl @@ -34,6 +34,15 @@ if ($module_name ne 'htaccess') { local ($ver, $mods) = &httpd_info($httpd); if ($ver) { local @mods = map { "$_/$ver" } &configurable_modules(); + foreach my $m (@mods) { + if ($m =~ /(\S+)\/(\S+)/) { + $httpd_modules{$1} = $2; + } + } + # Call again now that known modules have been set, as + # sometimes there are dependencies due to LoadModule + # statements in an IfModule block + @mods = map { "$_/$ver" } &configurable_modules(); local %site = ( 'size' => $st[7], 'path' => $httpd, 'modules' => join(' ', @mods), @@ -52,7 +61,9 @@ if (&read_file($site_file, \%site)) { local($m, $f, $d); $httpd_size = $site{'size'}; foreach $m (split(/\s+/, $site{'modules'})) { - if ($m =~ /(\S+)\/(\S+)/) { $httpd_modules{$1} = $2; } + if ($m =~ /(\S+)\/(\S+)/) { + $httpd_modules{$1} = $2; + } } foreach $m (keys %httpd_modules) { if (!-r "$module_root_directory/$m.pl") {