You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by "Philip M. Gollucci" <pg...@p6m7g8.com> on 2005/09/09 10:32:15 UTC

[PATCH] fix mp2bug output to find httpd correct

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 ******************

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->{$_};


-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] fix mp2bug output to find httpd correct

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
> 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(. ..);
I agree that its probably too generic but anything short of them copying
mp2bug into
other-distro/bin or other-distro wouldn't cause it to break.
I like you're idea better though, as it account for the above case too.

+1



> not really, I believe. It's possible that -httpd is not passed, in which 
> case this won't work.
I've yet to pass -httpd to anything other then Apache2::DebugFilter.
:)

Thats okay, I liked the first one better anyway.

-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] fix mp2bug output to find httpd correct

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
> 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(. ..);
I agree that its probably too generic but anything short of them copying
mp2bug into
other-distro/bin or other-distro wouldn't cause it to break.
I like you're idea better though, as it account for the above case too.

+1



> not really, I believe. It's possible that -httpd is not passed, in which 
> case this won't work.
I've yet to pass -httpd to anything other then Apache2::DebugFilter.
:)

Thats okay, I liked the first one better anyway.

-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com


Re: [PATCH] fix mp2bug output to find httpd correct

Posted by Stas Bekman <st...@stason.org>.
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

Re: [PATCH] fix mp2bug output to find httpd correct

Posted by Stas Bekman <st...@stason.org>.
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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org