You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2003/02/19 04:01:21 UTC
cvs commit: httpd-2.0/support apxs.in
nd 2003/02/18 19:01:21
Modified: . CHANGES
support apxs.in
Log:
insert LoadModule directives only outside of sections.
PR: 9012
Revision Changes Path
1.1079 +3 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.1078
retrieving revision 1.1079
diff -u -r1.1078 -r1.1079
--- CHANGES 18 Feb 2003 20:35:27 -0000 1.1078
+++ CHANGES 19 Feb 2003 03:01:20 -0000 1.1079
@@ -2,6 +2,9 @@
[Remove entries to the current 2.0 section below, when backported]
+ *) Fix apxs to insert LoadModule directives only outside of sections.
+ PR 9012. [Andr� Malo]
+
*) Hook mod_proxy's fixup before mod_rewrite's fixup, so that by
mod_rewrite proxied URLs will not be escaped accidentally by
mod_proxy's fixup. PR 16368 [Andr� Malo]
1.52 +23 -2 httpd-2.0/support/apxs.in
Index: apxs.in
===================================================================
RCS file: /home/cvs/httpd-2.0/support/apxs.in,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- apxs.in 3 Feb 2003 17:53:27 -0000 1.51
+++ apxs.in 19 Feb 2003 03:01:21 -0000 1.52
@@ -577,9 +577,30 @@
foreach $lmd (@lmd) {
my $what = $opt_A ? "preparing" : "activating";
if ($content !~ m|\n#?\s*$lmd|) {
- $content =~ s|^(.*\n#?\s*LoadModule\s+[^\n]+\n)|$1$c$lmd\n|sg;
+ # check for open <containers>, so that the new LoadModule
+ # directive always appears *outside* of an <container>.
+
+ my $before = ($content =~ m|^(.*\n)#?\s*LoadModule\s+[^\n]+\n|s)[0];
+ my $cntopen = () = ($before =~ m|^\s*<[^/].*$|mg);
+ my $cntclose = () = ($before =~ m|^\s*</.*$|mg);
+
+ if ($cntopen == $cntclose) {
+ # fine. Last LoadModule is contextless.
+ $content =~ s|^(.*\n#?\s*LoadModule\s+[^\n]+\n)|$1$c$lmd\n|s;
+ }
+ elsif ($cntopen < $cntclose) {
+ error('Configuration file is not valid. There are sections'
+ . ' closed before opened.');
+ exit(1);
+ }
+ else {
+ # put our cmd after the section containing the last
+ # LoadModule.
+ $content =~ s!\A((?:(?:^\s*(?:[^<]|<[^/]).*(?:$)\n)*^\s*</.*(?:$)\n?){$cntopen})!$1$c$lmd\n!m;
+ }
} else {
- $content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|sg;
+ # replace already existing LoadModule line
+ $content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|s;
}
$lmd =~ m|LoadModule\s+(.+?)_module.*|;
notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]");
Re: cvs commit: httpd-2.0/support apxs.in
Posted by André Malo <nd...@perlig.de>.
* Justin Erenkrantz wrote:
> Yet, I entertain
> no hope of understanding the perl-fu you used. (I might be able to
> test it lightly, but I doubt that's enough to merit a +1.)
I hope, the additional explanations will help ;-)
nd
--
Flhacs wird im Usenet grundsätzlich alsfhc geschrieben. Schreibt man
lafhsc nicht slfach, so ist das schlichtweg hclafs. Hingegen darf man
rihctig ruhig rhitcgi schreiben, weil eine shcalfe Schreibweise bei
irhictg nicht als shflac angesehen wird. -- Hajo Pflüger in dnq
Re: cvs commit: httpd-2.0/support apxs.in
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Wednesday, February 19, 2003 4:07 AM +0100 André Malo
<nd...@perlig.de> wrote:
> * nd@apache.org wrote:
>
>> nd 2003/02/18 19:01:21
>>
>> Modified: . CHANGES
>> support apxs.in
>> Log:
>> insert LoadModule directives only outside of sections.
>>
>> PR: 9012
>
> Hmm, I'm unsure. Is it desired to backport such changes? I'm
> asking, because the Bugreport was for 1.3 ...
Totally. This one has been a nuisance for a while. Yet, I entertain
no hope of understanding the perl-fu you used. (I might be able to
test it lightly, but I doubt that's enough to merit a +1.)
*me hugs python* -- justin
Re: cvs commit: httpd-2.0/support apxs.in
Posted by André Malo <nd...@perlig.de>.
* nd@apache.org wrote:
> nd 2003/02/18 19:01:21
>
> Modified: . CHANGES
> support apxs.in
> Log:
> insert LoadModule directives only outside of sections.
>
> PR: 9012
Hmm, I'm unsure. Is it desired to backport such changes? I'm asking,
because the Bugreport was for 1.3 ...
TIA, nd
--
package Hacker::Perl::Another::Just;print
qq~@{[reverse split/::/ =>__PACKAGE__]}~;
# André Malo # http://www.perlig.de #