From ohauer@gmx.de  Mon Apr 13 12:20:59 2009
Return-Path: <ohauer@gmx.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCA0E106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Apr 2009 12:20:59 +0000 (UTC)
	(envelope-from ohauer@gmx.de)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by mx1.freebsd.org (Postfix) with SMTP id 403198FC0A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 13 Apr 2009 12:20:58 +0000 (UTC)
	(envelope-from ohauer@gmx.de)
Received: (qmail invoked by alias); 13 Apr 2009 12:20:57 -0000
Received: from u18-124.dsl.vianetworks.de (EHLO u18-124.dsl.vianetworks.de) [194.231.39.124]
  by mail.gmx.net (mp060) with SMTP; 13 Apr 2009 14:20:57 +0200
Received: by u18-124.dsl.vianetworks.de (Postfix, from userid 1100)
	id D8B94CB74; Mon, 13 Apr 2009 14:20:53 +0200 (CEST)
Message-Id: <20090413122053.D8B94CB74@u18-124.dsl.vianetworks.de>
Date: Mon, 13 Apr 2009 14:20:53 +0200 (CEST)
From: olli hauer <ohauer@gmx.de>
Reply-To: olli hauer <ohauer@gmx.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: ohauer@gmx.de
Subject: apache22 apxs does not work as expected
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         133704
>Category:       ports
>Synopsis:       www/apache22 apxs does not work as expected
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    apache
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 13 12:30:00 UTC 2009
>Closed-Date:    Fri May 07 21:49:06 UTC 2010
>Last-Modified:  Sat May  8 12:20:04 UTC 2010
>Originator:     ohauer
>Release:        FreeBSD 7.1-RELEASE-p4 i386
>Organization:
>Environment:


>Description:
There is a miss behavior in the apxs script from apache22 (other versions not tested)

If you install a apache22 the LoadModule lines look like the following

 LoadModule *whitespace* ${modulename}_module *whitespace* libexec/apache22/mod_${modulename}.so

If you try now to activate/deactivate a module with apxs the result will differ from what you expect

>How-To-Repeat:

For the following test I will pick a long and two short module name (ssl autoindex cgi)

$> grep -e autoindex_ -e cgi_ httpd.conf
LoadModule autoindex_module libexec/apache22/mod_autoindex.so
LoadModule cgi_module libexec/apache22/mod_cgi.so


fire up the following commands

$> apxs -e -a -n autoindex mod_autoindex.so
[activating module `autoindex' in /usr/local/etc/apache22/httpd.conf]
$> apxs -e -a -n cgi mod_cgi.so
[activating module `cgi' in /usr/local/etc/apache22/httpd.conf]

This will result into the following httpd.conf

$> grep -e autoindex_ -e cgi_ httpd.conf
LoadModule autoindex_module libexec/apache22/mod_autoindex.so
LoadModule cgi_module libexec/apache22/mod_cgi.so
LoadModule autoindex_module   libexec/apache22/mod_autoindex.so
LoadModule cgi_module         libexec/apache22/mod_cgi.so


As you notice the modules are now loaded twice

Now try to deactivate for the loaded ssl module

$> grep ssl_ httpd.conf
LoadModule ssl_module libexec/apache22/mod_ssl.so

$> apxs -e -A -n ssl mod_ssl.so
[preparing module `ssl' in /usr/local/etc/apache22/httpd.conf]

$> grep ssl_ httpd.conf
LoadModule ssl_module libexec/apache22/mod_ssl.so
#LoadModule ssl_module         libexec/apache22/mod_ssl.so

Instead to deactivate the module a new line will be insert

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->apache 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Apr 13 17:38:53 UTC 2009 
Responsible-Changed-Why:  
Fix synopsis and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133704 
Responsible-Changed-From-To: apache->pgollucci 
Responsible-Changed-By: pgollucci 
Responsible-Changed-When: Sat May 16 03:30:19 UTC 2009 
Responsible-Changed-Why:  
started this one 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133704 

From: "Philip M. Gollucci" <pgollucci@p6m7g8.com>
To: bug-followup@FreeBSD.org, ohauer@gmx.de
Cc:  
Subject: Re: ports/133704: www/apache22 apxs does not work as expected
Date: Tue, 19 May 2009 01:12:49 -0400

 I take that, its a bug in apache22 and apache20 apparently.
 
 I'll fix this upstream and then pull the svn rev back in as a patch.
 
 /me is dumb founded that this can be possible.
 
Responsible-Changed-From-To: pgollucci->apache 
Responsible-Changed-By: pgollucci 
Responsible-Changed-When: Thu Apr 29 18:39:06 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133704 
State-Changed-From-To: open->analyzed 
State-Changed-By: pgollucci 
State-Changed-When: Fri May 7 20:46:39 UTC 2010 
State-Changed-Why:  
fix in upstream svn 

trunk: 2.3.x/2.4.x: http://svn.apache.org/viewvc?rev=942209&view=rev
2.2.x:              http://svn.apache.org/viewvc?rev=942210&view=rev
2.0.x:		    http://svn.apache.org/viewvc?rev=942211&view=rev

no future 1.3.x releases, no futher backports

This bug is almost as old has apxs and Apache httpd itself.

http://www.freebsd.org/cgi/query-pr.cgi?pr=133704 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/133704: commit references a PR
Date: Fri,  7 May 2010 20:54:03 +0000 (UTC)

 pgollucci    2010-05-07 20:53:45 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/apache22         Makefile 
     www/apache22/files   patch-support__apxs.in 
   Log:
   - Fix -A and -a options for apxs to correctly ignore whitespace.
     This will fix about 100 pkg-plist left overs for httpd.conf
   - Bump PORTREVISION
   -  This will be in 2.2.16.
   
   PR:             ports/133704
   Obtained from:  http://svn.apache.org/viewvc?rev=942210&view=rev
   Reported by:    olli hauer <ohauer@gmx.de> (and very good pr!)
   With Hat:       apache@
   
   Revision  Changes    Path
   1.265     +1 -1      ports/www/apache22/Makefile
   1.2       +22 -1     ports/www/apache22/files/patch-support__apxs.in
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: analyzed->closed 
State-Changed-By: pgollucci 
State-Changed-When: Fri May 7 21:49:05 UTC 2010 
State-Changed-Why:  
done and done! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133704 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/133704: commit references a PR
Date: Fri,  7 May 2010 21:46:33 +0000 (UTC)

 pgollucci    2010-05-07 21:46:21 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/apache22         Makefile pkg-plist 
     www/apache22/files   patch-support__apxs.in 
   Log:
   - Continuation of ports/133704
     apxs -A comments out the LoadModule line
     This adds custom FreeBSD mod to 'DELETE' the line so that it works with
     our pkg-plists in packages.
   - Remove -s form the cmp httpd.conf in pkg-plist to be blatant about why
     it didn't get removed
   - Tested with lang/php5
   - Bump PORTREVISION
   
   PR:             ports/133704
   With Hat:       apache@
   
   Revision  Changes    Path
   1.266     +1 -1      ports/www/apache22/Makefile
   1.3       +9 -3      ports/www/apache22/files/patch-support__apxs.in
   1.97      +2 -2      ports/www/apache22/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/133704: commit references a PR
Date: Fri,  7 May 2010 21:49:06 +0000 (UTC)

 pgollucci    2010-05-07 21:48:58 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/apache20         Makefile pkg-plist 
     www/apache20/files   patch-support__apxs.in 
   Log:
   - Fix -A and -a options for apxs to correctly ignore whitespace.
     This will fix about 100 pkg-plist left overs for httpd.conf
     apxs -A comments out the LoadModule line
     This adds custom FreeBSD mod to 'DELETE' the line so that it works with
     our pkg-plists in packages.
   - Remove -s form the cmp httpd.conf in pkg-plist to be blatant about why
     it didn't get removed
   - Bump PORTREVISION
   - This will be in 2.0.64
   
   PR:             ports/133704
   Obtained from:  http://svn.apache.org/viewvc?rev=942211&view=rev
   Reported by:    olli hauer <ohauer@gmx.de> (and very good pr!)
   With Hat:       apache@
   
   Revision  Changes    Path
   1.276     +1 -1      ports/www/apache20/Makefile
   1.2       +22 -1     ports/www/apache20/files/patch-support__apxs.in
   1.88      +2 -2      ports/www/apache20/pkg-plist
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: olli hauer <ohauer@gmx.de>
To: pgollucci@FreeBSD.org, bug-followup@FreeBSD.org
Cc: apache@FreeBSD.org, Olli Hauer <ohauer@gmx.de>
Subject: Re: ports/133704: www/apache22 apxs does not work as expected
Date: Sat, 08 May 2010 14:17:33 +0200

 pgollucci@FreeBSD.org wrote:
 > Synopsis: www/apache22 apxs does not work as expected
 > 
 > State-Changed-From-To: analyzed->closed
 > State-Changed-By: pgollucci
 > State-Changed-When: Fri May 7 21:49:05 UTC 2010
 > State-Changed-Why: 
 > done and done!
 > 
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=133704
 > 
 
 Hi,
 
 thanks for fixing this bug;)
 
 Btw. since you are a member off apache.org, maybe you want to close
 the following bugzilla issue.
 https://issues.apache.org/bugzilla/show_bug.cgi?id=47397
 
 One note:
 The FreeBSD hack removes the line complete so it is possible
 to breaks apache if someone use apxs to control modules not
 installed by a port since it removes the line completely.
 
 
 What do you think about this hack (add an addition parameter [-r] to remove the 
 line)
 
 --- patch_apxs.txt begins here ---
 --- /usr/local/sbin/apxs        2010-05-08 11:38:09.000000000 +0200
 +++ apxs        2010-05-08 13:55:32.000000000 +0200
 @@ -72,6 +72,7 @@
   my $opt_i = 0;
   my $opt_a = 0;
   my $opt_A = 0;
 +my $opt_r = 0;
   my $opt_q = 0;
   my $opt_h = 0;
   my $opt_p = 0;
 @@ -148,12 +149,14 @@
       print STDERR "               [-Wl,<flags>] [-p] <files> ...\n";
       print STDERR "       apxs -i [-S <var>=<val>] [-a] [-A] [-n <modname>] 
 <dsofile> ...\n";
       print STDERR "       apxs -e [-S <var>=<val>] [-a] [-A] [-n <modname>] 
 <dsofile> ...\n";
 +    # FreeBSD hack, remove the line instead commenting out
 +    print STDERR "       apxs -e [-r] [-A] [-n <modname>] <dsofile> ...\n";
       exit(1);
   }
 
   #   option handling
   my $rc;
 -($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+S+eiaAp", @ARGV);
 +($rc, @ARGV) = &Getopts("qn:gco:I+D+L+l+W+S+eiaApr", @ARGV);
   &usage if ($rc == 0);
   &usage if ($#ARGV == -1 and not $opt_g);
   &usage if (not $opt_q and not ($opt_g and $opt_n) and not $opt_i and not 
 $opt_c and not $opt_e);
 @@ -614,7 +617,7 @@
               } else {
                   # replace already existing LoadModule line
                   # Custom FreeBSD mod
 -                if ($opt_A) {
 +                if ($opt_A and $opt_r) {
                       $content =~ s|^(.*\n)#?\s*$lmd_re[^\n]*\n|$1|s;
                   }
                   else {
 --- patch_apxs.txt ends here ---
 
 
 
>Unformatted:
