httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [PATCH] fix mp2bug output to find httpd correct
Date Fri, 09 Sep 2005 16:53:19 GMT
Philip M. Gollucci wrote:
> Hi,
> 
> [Sorry for the cross post, but I'm not really sure who's issue it is]
> 
> Note 2 patches, which one is best... MP2 or A-T (see below)
> 
> Under several situations, I can cause mp2bug to not find httpd or any 
> installed modules.  More on the modules later.
> 
> The reason being is that
> 
> modperl/trunk/lib/Apache2/Build.pm::use constant IS_MOD_PERL_BUILD => 
> grep { -e "$_/lib/mod_perl2.pm" } qw(. ..);
> Blows up.  I'm pretty sure this happens under several circumstances.
> I can name at least 2:
>   1.
> /usr/home/pgollucci/dev/apps/perl-5.8.7/bin/perl Makefile.PL \
>  MP_APXS=/usr/home/pgollucci/dev/apps/httpd-2.3.0/bin/apxs \
>  MP_MAINTAINER=1 \
>  MP_DEBUG=1 \
>  MP_TRACE=1 \
>  PREFIX=/usr/home/pgollucci/dev/apps/mod_perl-2.0.2
> 
> ExtUtils::MakeMaker PREFIX breaks this as now you have a dir structure
> mod_perl-2.0.2
>   bin/
>      mp2bug
>   lib
>      mod_perl2.pm
> 
>   2.
> /usr/home/pgollucci/dev/apps/perl-5.8.7/bin/perl Makefile.PL \
>  MP_APXS=/usr/home/pgollucci/dev/apps/httpd-2.3.0/bin/apxs \
>  MP_MAINTAINER=1 \
>  MP_DEBUG=1 \
>  MP_TRACE=1 \
> 
> This doesn't work for me either... Though I can't quite explain it as 
> easily.
> 
> Would it not make more sense to look for "$_/Makefile.PL" ?
> Index: lib/Apache2/Build.pm
> ===================================================================
> --- lib/Apache2/Build.pm        (revision 279713)
> +++ lib/Apache2/Build.pm        (working copy)
> @@ -26,7 +26,7 @@
>  use ExtUtils::Embed ();
>  use File::Copy ();
> 
> -use constant IS_MOD_PERL_BUILD => grep { -e "$_/lib/mod_perl2.pm" } 
> qw(. ..);
> +use constant IS_MOD_PERL_BUILD => grep { -e "$_/Makefile.PL" } qw(. ..);
> 
>  use constant AIX     => $^O eq 'aix';
>  use constant DARWIN  => $^O eq 'darwin';
> 
> *************** OR ******************

It's too risky to just check for Makefile.PL, since it's too generic. What 
if someone decides to run mp2bug while residing in the source directory of 
some other perl distro? How about:

use constant IS_MOD_PERL_BUILD => grep
     { -e "$_/Makefile.PL" && -e "$_/lib/mod_perl2.pm" } qw(. ..);

> If not, this wors instead
> 
> pgollucci@pgollucci.internal.liquidation.com 
> /home/pgollucci/dev/repos/asf/perl/modperl/trunk/Apache-Test/lib/Apache 
> rv=0 426 >svn diff
> Index: TestConfig.pm
> ===================================================================
> --- TestConfig.pm       (revision 279713)
> +++ TestConfig.pm       (working copy)
> @@ -2147,9 +2147,10 @@
> 
>      # mod_perl 2.0 build always knows the right httpd location (and
>      # optionally apxs)
> +    # BUT bin/mp2bug does not neccessarily know this information
>      $vars_must_overriden++ if IS_MOD_PERL_2_BUILD();
> 
> -    unless ($vars_must_overriden) {
> +    unless ($vars_must_overriden && exists $args->{httpd}) {
>          for (@data_vars_must) {
>              next unless $Apache::TestConfigData::vars->{$_};
>              $args->{$_} = $Apache::TestConfigData::vars->{$_};

not really, I believe. It's possible that -httpd is not passed, in which 
case this won't work.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://mailchannels.com

Mime
View raw message