You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Joe Orton <jo...@redhat.com> on 2002/11/27 17:18:26 UTC
[PATCH] prevent apxs from inserting AddModule
If an httpd.conf has commented out AddModule directives, apxs -i -a will
add an un-commented AddModule directive for the new module, which breaks
the config. Here's a fix:
--- support/apxs.in 19 Sep 2002 05:43:16 -0000 1.47
+++ support/apxs.in 27 Nov 2002 16:12:00 -0000
@@ -490,9 +490,8 @@
##
# determine installation commands
- # and corresponding LoadModule/AddModule directives
+ # and corresponding LoadModule directive
my @lmd = ();
- my @amd = ();
my @cmds = ();
my $f;
foreach $f (@args) {
@@ -546,7 +545,6 @@
$dir =~ s|(.)$|$1/|;
$t =~ s|\.la$|.so|;
push(@lmd, sprintf("LoadModule %-18s %s", "${name}_module", "$dir$t"));
- push(@amd, sprintf("AddModule %s", $filename));
}
# execute the commands
@@ -582,15 +580,7 @@
$lmd =~ m|LoadModule\s+(.+?)_module.*|;
notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]");
}
- my $amd;
- foreach $amd (@amd) {
- if ($content !~ m|\n#?\s*$amd|) {
- $content =~ s|^(.*\n#?\s*AddModule\s+[^\n]+\n)|$1$c$amd\n|sg;
- } else {
- $content =~ s|^(.*\n)#?\s*$amd[^\n]*\n|$1$c$amd\n|sg;
- }
- }
- if (@lmd or @amd) {
+ if (@lmd) {
if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) {
print FP $content;
close(FP);