httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/support apxs.in
Date Wed, 19 Feb 2003 03:01:21 GMT
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]");
  
  
  

Mime
View raw message