wsanchez 99/07/09 14:44:37
Modified: src CHANGES
src/support apxs.8 apxs.pl
Log:
Fix up apxs editing code so that multiple invocations of apxs -a will
not result in multiple LoadModule/AddModule entries for that module;
apxs can now be used to re- enable/disable modules that were installed
using apxs.
Revision Changes Path
1.1395 +4 -2 apache-1.3/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-1.3/src/CHANGES,v
retrieving revision 1.1394
retrieving revision 1.1395
diff -u -r1.1394 -r1.1395
--- CHANGES 1999/07/08 01:18:28 1.1394
+++ CHANGES 1999/07/09 21:44:23 1.1395
@@ -2,8 +2,10 @@
*) apxs: Add "-S var=val" option which allows for override of CFG_*
built-in values. Add "-e" option which works like -i but doesn't
- install the DSO; useful for editing httpd.conf with apxs.
- [Wilfredo Sanchez]
+ install the DSO; useful for editing httpd.conf with apxs. Fix
+ editing code so that multiple invocations of apxs -a will not
+ create duplicate LoadModule/AddModule entries; apxs can now be
+ used to re- enable/disable a module. [Wilfredo Sanchez]
*) Win32: Update the server to use Winsock 2. Specifically, link with
ws2_32.lib rather than wsock32.lib. This gives us access to
1.9 +3 -5 apache-1.3/src/support/apxs.8
Index: apxs.8
===================================================================
RCS file: /home/cvs/apache-1.3/src/support/apxs.8,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- apxs.8 1999/07/08 01:18:31 1.8
+++ apxs.8 1999/07/09 21:44:31 1.9
@@ -332,20 +332,18 @@
directory.
.TP 12
.B \-a
-This additionally activates the module
-by automatically adding a corresponding
+This activates the module by automatically adding a corresponding
.B LoadModule
line to Apache's
.B httpd.conf
-configuration file (only if no such entry exists yet).
+configuration file, or by enabling it if it already exists.
.TP 12
.B \-A
Same as option
.B \-a
but the created
.B LoadModule
-directive is
-prefixed with a hash sign (#), i.e. the module is
+directive is prefixed with a hash sign (#), i.e. the module is
just prepared for later activation but initially disabled.
.TP 12
.B \-e
1.24 +10 -11 apache-1.3/src/support/apxs.pl
Index: apxs.pl
===================================================================
RCS file: /home/cvs/apache-1.3/src/support/apxs.pl,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- apxs.pl 1999/07/08 01:18:32 1.23
+++ apxs.pl 1999/07/09 21:44:32 1.24
@@ -485,29 +485,28 @@
exit(1);
}
- my $update = 0;
my $lmd;
+ my $c = '';
+ $c = '#' if ($opt_A);
foreach $lmd (@lmd) {
+ my $what = $opt_A ? "preparing" : "activating";
if ($content !~ m|\n#?\s*$lmd|) {
- my $c = '';
- $c = '#' if ($opt_A);
$content =~
s|^(.*\n#?\s*LoadModule\s+[^\n]+\n)|$1$c$lmd\n|sg;
- $update = 1;
- $lmd =~ m|LoadModule\s+(.+?)_module.*|;
- my $what = $opt_A ? "preparing" : "activating";
- print STDERR "[$what module `$1' in
$CFG_SYSCONFDIR/$CFG_TARGET.conf]\n";
+ } else {
+ $content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|sg;
}
+ $lmd =~ m|LoadModule\s+(.+?)_module.*|;
+ print STDERR "[$what module `$1' in
$CFG_SYSCONFDIR/$CFG_TARGET.conf]\n";
}
my $amd;
foreach $amd (@amd) {
if ($content !~ m|\n#?\s*$amd|) {
- my $c = '';
- $c = '#' if ($opt_A);
$content =~
s|^(.*\n#?\s*AddModule\s+[^\n]+\n)|$1$c$amd\n|sg;
- $update = 1;
+ } else {
+ $content =~ s|^(.*\n)#?\s*$amd[^\n]*\n|$1$c$amd\n|sg;
}
}
- if ($update) {
+ if (@lmd or @amd) {
open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new") || die;
print FP $content;
close(FP);