Discussion:
[PATCH] fix mp2bug output to find httpd correct
Philip M. Gollucci
2005-09-09 08:32:15 UTC
Permalink
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.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 (***@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
Stas Bekman
2005-09-09 16:53:19 UTC
Permalink
Post by Philip M. Gollucci
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.
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(. ..);
Post by Philip M. Gollucci
If not, this wors instead
/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}) {
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:***@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://mailchannels.com
Philip M. Gollucci
2005-09-09 17:13:03 UTC
Permalink
Post by Stas Bekman
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
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
Post by Stas Bekman
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 (***@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
Loading...