apache-dispatch-devel Mailing List for Apache::Dispatch (Page 2)
Brought to you by:
geoffrey_young,
phred_moyer
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(4) |
Apr
(33) |
May
(10) |
Jun
(22) |
Jul
(3) |
Aug
(15) |
Sep
(3) |
Oct
(3) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
| 2008 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(11) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Fred M. <fr...@re...> - 2008-06-22 08:27:23
|
Geoff, if this Apache::Bootstrap module proves successful in making this makefile easy to write, do you know of any licensing issues that it might run into? It uses ASF licensed code, so I don't know if it would have to be an official mod_perl project. I'm going to push out 0.03 tomorrow, maybe it is worthwhile, maybe not, but it has make this makefile business a lot easier to deal with :) phr...@us... wrote: > Revision: 67 > http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=67&view=rev > Author: phred_moyer > Date: 2008-06-22 01:13:40 -0700 (Sun, 22 Jun 2008) > > Log Message: > ----------- > Simply again with next version of Apache::Bootstrap. This rats nets is > getting simpler but I only managed to lose 10 lines on this latest > revision :) > > None the less, this stuff is a lot easier to setup now. > > Modified Paths: > -------------- > trunk/Makefile.PL > > Modified: trunk/Makefile.PL > =================================================================== > --- trunk/Makefile.PL 2008-06-21 09:15:40 UTC (rev 66) > +++ trunk/Makefile.PL 2008-06-22 08:13:40 UTC (rev 67) > @@ -5,39 +5,45 @@ > > use Config; > > -BEGIN { > - my $AB_VER = 0.02; > - my $fail_msg = "Warning: prerequisite Apache::Bootstrap $AB_VER not found."; > - > - eval { require Apache::Bootstrap }; > - die $fail_msg . "\n" if $@; > +# minimum version of A::B required > +use Apache::Bootstrap 0.03; > > - die $fail_msg . " We have $Apache::Bootstrap::VERSION.\n" > - if $Apache::Bootstrap::VERSION < $AB_VER; > +my $bootstrap; > + > +BEGIN { > + # make sure we have at least one minimum version required > + $bootstrap = Apache::Bootstrap->new({ mod_perl2 => '1.99022', mod_perl => 0, }); > } > > -my %prereqs = ( ); > -my %mp2 = ( mod_perl2 => 1.99022 ); > -my %mp1 = ( mod_perl => 0 ); > - > +# allow builds with mod_perl one when MOD_PERL_1_BUILD ENV is set > my $mp_gen; > -if ( $ENV{MOD_PERL_2_BUILD} ) { > - push @ARGV, "-apxs $ENV{MP_APXS}"; > - my $mp_gen = Apache::Bootstrap->satisfy_mp_generation(2); > +if ( $ENV{MOD_PERL_1_BUILD} ) { > + > + $mp_gen = $bootstrap->satisfy_mp_generation(1); > +} else { > + > + # else we build for mp2 > + push @ARGV, "-apxs $ENV{MP_APXS}" if exists $ENV{MP_APXS}; > + $mp_gen = $bootstrap->satisfy_mp_generation(2); > } > -else { > - $mp_gen = Apache::Bootstrap->satisfy_mp_generation(); > -} > > -%prereqs = ( $mp_gen == 1 ? %mp1 : %mp2 ); > +# check for Apache::Test, $HAS_APACHE_TEST contains version or is undefined > +my $HAS_APACHE_TEST = $bootstrap->check_for_apache_test(); > > -my $HAS_APACHE_TEST = Apache::Bootstrap->check_for_apache_test(); > +# calculate common makefile version vars > +my $apache = $bootstrap->apache_major_version; > +my $base_lib = "lib/$apache/Dispatch.pm"; > > -my %common_opts = ( > - PREREQ_PM => \%prereqs, > - clean => { FILES => 't/TEST, *.xs*' }, > +# common makefile build options > +my %maker_opts = ( > + PREREQ_PM => $bootstrap->mp_prereqs, > + clean => { FILES => 't/TEST, *.xs*' }, > + NAME => "$apache\::Dispatch", > + VERSION_FROM => $base_lib, > + ABSTRACT_FROM => $base_lib, > ); > > + > if ( $mp_gen == 1 ) { > > # Build directives using xs or PerlSetVar > @@ -46,7 +52,7 @@ > eval { > require Apache::ExtUtils; > require Apache::src; > - }; > + }; > > if ( $@ || $ENV{DISPATCH_PUREPERL} ) { > print > @@ -72,30 +78,14 @@ > $makefile_params{'INC'} = $inc; > } > > - require ExtUtils::MakeMaker; > - ExtUtils::MakeMaker::WriteMakefile( > - %common_opts, > - %makefile_params, > - VERSION_FROM => "lib/Apache/Dispatch.pm", > - NAME => "Apache::Dispatch", > - ABSTRACT_FROM => 'lib/Apache/Dispatch.pm', > - ); > + %maker_opts = ( %maker_opts, %makefile_params ); > > } > -else { > - require ModPerl::MM; > - ModPerl::MM::WriteMakefile( > - %common_opts, > - VERSION_FROM => "lib/Apache2/Dispatch.pm", > - NAME => "Apache2::Dispatch", > - ABSTRACT_FROM => 'lib/Apache2/Dispatch.pm', > - ); > -} > > -if ( $ENV{MOD_PERL_2_BUILD} ) { > - pop @ARGV; > -} > +$bootstrap->WriteMakefile( %maker_opts ); > > +pop @ARGV unless $ENV{MOD_PERL_1_BUILD}; > + > package MY; > > sub postamble { > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Apache-dispatch-devel mailing list > Apa...@li... > https://lists.sourceforge.net/lists/listinfo/apache-dispatch-devel |
|
From: <phr...@us...> - 2008-06-22 08:13:35
|
Revision: 67
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=67&view=rev
Author: phred_moyer
Date: 2008-06-22 01:13:40 -0700 (Sun, 22 Jun 2008)
Log Message:
-----------
Simply again with next version of Apache::Bootstrap. This rats nets is
getting simpler but I only managed to lose 10 lines on this latest
revision :)
None the less, this stuff is a lot easier to setup now.
Modified Paths:
--------------
trunk/Makefile.PL
Modified: trunk/Makefile.PL
===================================================================
--- trunk/Makefile.PL 2008-06-21 09:15:40 UTC (rev 66)
+++ trunk/Makefile.PL 2008-06-22 08:13:40 UTC (rev 67)
@@ -5,39 +5,45 @@
use Config;
-BEGIN {
- my $AB_VER = 0.02;
- my $fail_msg = "Warning: prerequisite Apache::Bootstrap $AB_VER not found.";
-
- eval { require Apache::Bootstrap };
- die $fail_msg . "\n" if $@;
+# minimum version of A::B required
+use Apache::Bootstrap 0.03;
- die $fail_msg . " We have $Apache::Bootstrap::VERSION.\n"
- if $Apache::Bootstrap::VERSION < $AB_VER;
+my $bootstrap;
+
+BEGIN {
+ # make sure we have at least one minimum version required
+ $bootstrap = Apache::Bootstrap->new({ mod_perl2 => '1.99022', mod_perl => 0, });
}
-my %prereqs = ( );
-my %mp2 = ( mod_perl2 => 1.99022 );
-my %mp1 = ( mod_perl => 0 );
-
+# allow builds with mod_perl one when MOD_PERL_1_BUILD ENV is set
my $mp_gen;
-if ( $ENV{MOD_PERL_2_BUILD} ) {
- push @ARGV, "-apxs $ENV{MP_APXS}";
- my $mp_gen = Apache::Bootstrap->satisfy_mp_generation(2);
+if ( $ENV{MOD_PERL_1_BUILD} ) {
+
+ $mp_gen = $bootstrap->satisfy_mp_generation(1);
+} else {
+
+ # else we build for mp2
+ push @ARGV, "-apxs $ENV{MP_APXS}" if exists $ENV{MP_APXS};
+ $mp_gen = $bootstrap->satisfy_mp_generation(2);
}
-else {
- $mp_gen = Apache::Bootstrap->satisfy_mp_generation();
-}
-%prereqs = ( $mp_gen == 1 ? %mp1 : %mp2 );
+# check for Apache::Test, $HAS_APACHE_TEST contains version or is undefined
+my $HAS_APACHE_TEST = $bootstrap->check_for_apache_test();
-my $HAS_APACHE_TEST = Apache::Bootstrap->check_for_apache_test();
+# calculate common makefile version vars
+my $apache = $bootstrap->apache_major_version;
+my $base_lib = "lib/$apache/Dispatch.pm";
-my %common_opts = (
- PREREQ_PM => \%prereqs,
- clean => { FILES => 't/TEST, *.xs*' },
+# common makefile build options
+my %maker_opts = (
+ PREREQ_PM => $bootstrap->mp_prereqs,
+ clean => { FILES => 't/TEST, *.xs*' },
+ NAME => "$apache\::Dispatch",
+ VERSION_FROM => $base_lib,
+ ABSTRACT_FROM => $base_lib,
);
+
if ( $mp_gen == 1 ) {
# Build directives using xs or PerlSetVar
@@ -46,7 +52,7 @@
eval {
require Apache::ExtUtils;
require Apache::src;
- };
+ };
if ( $@ || $ENV{DISPATCH_PUREPERL} ) {
print
@@ -72,30 +78,14 @@
$makefile_params{'INC'} = $inc;
}
- require ExtUtils::MakeMaker;
- ExtUtils::MakeMaker::WriteMakefile(
- %common_opts,
- %makefile_params,
- VERSION_FROM => "lib/Apache/Dispatch.pm",
- NAME => "Apache::Dispatch",
- ABSTRACT_FROM => 'lib/Apache/Dispatch.pm',
- );
+ %maker_opts = ( %maker_opts, %makefile_params );
}
-else {
- require ModPerl::MM;
- ModPerl::MM::WriteMakefile(
- %common_opts,
- VERSION_FROM => "lib/Apache2/Dispatch.pm",
- NAME => "Apache2::Dispatch",
- ABSTRACT_FROM => 'lib/Apache2/Dispatch.pm',
- );
-}
-if ( $ENV{MOD_PERL_2_BUILD} ) {
- pop @ARGV;
-}
+$bootstrap->WriteMakefile( %maker_opts );
+pop @ARGV unless $ENV{MOD_PERL_1_BUILD};
+
package MY;
sub postamble {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <phr...@us...> - 2008-06-21 10:04:49
|
Revision: 66
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=66&view=rev
Author: phred_moyer
Date: 2008-06-21 02:15:40 -0700 (Sat, 21 Jun 2008)
Log Message:
-----------
Reduce unnecessary log verbosity, especially when DispatchDebug is not set :)
Modified Paths:
--------------
trunk/Changes
trunk/lib/Apache/Dispatch/Util.pm
trunk/lib/Apache/Dispatch.pm
trunk/lib/Apache2/Dispatch.pm
Modified: trunk/Changes
===================================================================
--- trunk/Changes 2008-06-21 08:43:13 UTC (rev 65)
+++ trunk/Changes 2008-06-21 09:15:40 UTC (rev 66)
@@ -1,6 +1,7 @@
Revision history for Perl extension Apache::Dispatch
0.11
+ - reduce unnecessary log verbosity
- use Apache::Bootstrap to bootstrap mod_perl version
0.10 01.08.2008
Modified: trunk/lib/Apache/Dispatch/Util.pm
===================================================================
--- trunk/lib/Apache/Dispatch/Util.pm 2008-06-21 08:43:13 UTC (rev 65)
+++ trunk/lib/Apache/Dispatch/Util.pm 2008-06-21 09:15:40 UTC (rev 66)
@@ -193,12 +193,12 @@
$stat{$module} = $^T unless $stat{$module};
if ($INC{$module}) {
- $log->info("\tchecking $module for reload in pid $$...");
+ $log->debug("\tchecking $module for reload in pid $$...");
my $mtime = (stat $INC{$module})[9];
unless (defined $mtime && $mtime) {
- $log->warn("Apache::Dispatch cannot find $module!");
+ $log->error("Apache::Dispatch cannot find $module!");
return 1;
}
@@ -220,11 +220,11 @@
$stat{$module} = $mtime;
}
else {
- $log->info("\t$module not modified");
+ $log->debug("\t$module not modified");
}
}
else {
- $log->warn("Apache::Dispatch: $module not in \%INC!");
+ $log->error("Apache::Dispatch: $module not in \%INC!");
}
return 1;
@@ -327,8 +327,8 @@
(my $class_and_method = $r->uri) =~ s!/!::!g;
if ($newloc) {
- $log->info("\tmodifying location from ", $r->location, " to $newloc")
- if $debug > 1;
+ $log->debug("\tmodifying location from ", $r->location, " to $newloc")
+ if $debug > 1;
($location = $newloc) =~ s!/!::!g;
}
else {
@@ -355,7 +355,7 @@
}
unless ($times) {
- $log->info("\tLocation substitution failed - uri not translated")
+ $log->debug("\tLocation substitution failed - uri not translated")
if $debug > 1;
return (undef, undef);
@@ -390,7 +390,7 @@
my $coderef;
- $log->info("\tchecking the validity of $class->$method...")
+ $log->debug("\tchecking the validity of $class->$method...")
if $debug > 1;
if ($autoload) {
@@ -401,10 +401,10 @@
}
if ($coderef && $debug > 1) {
- $log->info("\t$class->$method is a valid method call");
+ $log->debug("\t$class->$method is a valid method call");
}
elsif ($debug > 1) {
- $log->info("\t$class->$method is not a valid method call");
+ $log->debug("\t$class->$method is not a valid method call");
}
return $coderef;
Modified: trunk/lib/Apache/Dispatch.pm
===================================================================
--- trunk/lib/Apache/Dispatch.pm 2008-06-21 08:43:13 UTC (rev 65)
+++ trunk/lib/Apache/Dispatch.pm 2008-06-21 09:15:40 UTC (rev 66)
@@ -88,12 +88,11 @@
# do some preliminary stuff...
#---------------------------------------------------------------------
- $log->info("Using Apache::Dispatch") if $debug;
+ $log->debug("Using Apache::Dispatch") if $debug;
# redefine $r as necessary for Apache::Filter 1.013 and above
if ($filter) {
- $log->info("\tregistering handler with Apache::Filter")
- if $debug > 1;
+ $log->debug("\tregistering handler with Apache::Filter") if $debug > 1;
# in case we used DispatchFilter directive instead, make sure
# that other filters in the chain recognize us...
@@ -104,21 +103,20 @@
$log = $r->server->log;
}
- $log->info("\tchecking $uri for possible dispatch...")
- if $debug > 1;
+ $log->debug("\tchecking $uri for possible dispatch...") if $debug > 1;
# if the uri contains any characters we don't like, bounce...
# is this necessary?
if (__PACKAGE__->bogus_uri($uri)) {
if ($debug) {
- $log->info("\t$uri has bogus characters...");
- $log->info("Exiting Apache::Dispatch");
+ $log->error("\t$uri has bogus characters...");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
}
return DECLINED;
}
if ($debug > 1) {
- $log->info(
+ $log->debug(
"\tapplying the following dispatch rules:",
"\n\t\tDispatchPrefix: ",
$prefix,
@@ -151,9 +149,8 @@
__PACKAGE__->_translate_uri($r, $prefix, $new_location, $log, $debug);
unless ($class && $method) {
- $log->info("\tclass and method could not be discovered")
- if $debug;
- $log->info("Exiting Apache::Dispatch") if $debug > 0;
+ $log->error("\tclass and method could not be discovered");
+ $log->debug("Exiting Apache::Dispatch") if $debug;;
return DECLINED;
}
@@ -174,7 +171,7 @@
unless ($rc) {
$log->error("\tDispatchISA did not return successfully!");
- $log->info("Exiting Apache::Dispatch");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
}
@@ -184,19 +181,17 @@
#---------------------------------------------------------------------
if ($require) {
- $log->info("\tattempting to require $class...")
- if $debug > 1;
+ $log->debug("\tattempting to require $class...") if $debug > 1;
eval "require $class";
if ($@) {
- $log->warn("\tcould not require $class: $@");
- $log->info("Exiting Apache::Dispatch");
+ $log->error("\tcould not require $class: $@");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
else {
- $log->info("\t$class required successfully")
- if $debug > 1;
+ $log->debug("\t$class required successfully") if $debug > 1;
}
}
@@ -209,7 +204,7 @@
unless ($rc) {
$log->error("\tDispatchStat did not return successfully!");
- $log->info("Exiting Apache::Dispatch");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
}
@@ -218,7 +213,7 @@
unless ($rc) {
$log->error("\tDispatchStat did not return successfully!");
- $log->info("Exiting Apache::Dispatch");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
}
@@ -232,13 +227,11 @@
__PACKAGE__->_check_dispatch($object, $method, $autoload, $log, $debug);
if ($handler) {
- $log->info("\t$uri was translated into $class->$method")
- if $debug;
+ $log->debug("\t$uri was translated into $class->$method") if $debug;
}
else {
- $log->info("\t$uri did not result in a valid method")
- if $debug;
- $log->info("Exiting Apache::Dispatch");
+ $log->error("\t$uri did not result in a valid method");
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return DECLINED;
}
@@ -287,11 +280,8 @@
# wrap up...
#---------------------------------------------------------------------
- $log->info("\tApache::Dispatch is returning $rc")
- if $debug;
-
- $log->info("Exiting Apache::Dispatch");
-
+ $log->debug("\tApache::Dispatch is returning $rc") if $debug;
+ $log->debug("Exiting Apache::Dispatch") if $debug;
return $rc;
}
Modified: trunk/lib/Apache2/Dispatch.pm
===================================================================
--- trunk/lib/Apache2/Dispatch.pm 2008-06-21 08:43:13 UTC (rev 65)
+++ trunk/lib/Apache2/Dispatch.pm 2008-06-21 09:15:40 UTC (rev 66)
@@ -55,7 +55,7 @@
# do some preliminary stuff...
#---------------------------------------------------------------------
- $log->debug("Using Apache2::Dispatch");
+ $log->debug("Using Apache2::Dispatch, debug level $debug") if $debug;
$log->debug("\tchecking $uri for possible dispatch...")
if $debug > 1;
@@ -64,13 +64,13 @@
if (__PACKAGE__->bogus_uri($uri)) {
if ($debug) {
- $log->info("\t$uri has bogus characters...");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("\t$uri has bogus characters...");
+ $log->debug("Exiting Apache2::Dispatch");
}
return Apache2::Const::DECLINED;
}
- if ($debug > 1) {
- $log->debug(
+
+ $log->debug(
"\tapplying the following dispatch rules:",
"\n\t\tDispatchPrefix: ",
$prefix,
@@ -90,8 +90,7 @@
(@extras ? (join ' ', @extras) : "None"),
"\n\t\tDispatchISA: ",
(@parents ? (join ' ', @parents) : "None"),
- );
- }
+ ) if $debug > 1;
#---------------------------------------------------------------------
# create the new object
@@ -123,7 +122,7 @@
unless ($rc) {
$log->error("\tDispatchISA did not return successfully!");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
}
@@ -133,17 +132,17 @@
#---------------------------------------------------------------------
if ($require) {
- $log->info("\tattempting to require $class...");
+ $log->debug("\tattempting to require $class...") if $debug > 1;
eval "require $class";
if ($@) {
$log->warn("\tcould not require $class: $@");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
else {
- $log->info("\t$class required successfully");
+ $log->debug("\t$class required successfully") if $debug > 1;
}
}
@@ -156,7 +155,7 @@
unless ($rc) {
$log->error("\tDispatchStat did not return successfully!");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
}
@@ -165,7 +164,7 @@
unless ($rc) {
$log->error("\tDispatchStat did not return successfully!");
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
}
@@ -178,11 +177,11 @@
my $handler = __PACKAGE__->_check_dispatch($object, $method, $autoload, $log, $debug);
if ($handler) {
- $log->info("\t$uri was translated into $class->$method");
+ $log->debug("\t$uri was translated into $class->$method") if $debug;
}
else {
- $log->info("\t$uri did not result in a valid method");
- $log->info("Exiting Apache2::Dispatch");
+ $log->error("\t$uri did not result in a valid method");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return Apache2::Const::DECLINED;
}
@@ -228,9 +227,9 @@
# wrap up...
#---------------------------------------------------------------------
- $log->info("\tApache2::Dispatch is returning $rc");
+ $log->debug("\tApache2::Dispatch is returning $rc") if $debug;
- $log->info("Exiting Apache2::Dispatch");
+ $log->debug("Exiting Apache2::Dispatch") if $debug;
return $rc;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Fred M. <fr...@re...> - 2008-02-17 06:22:38
|
> Michael G Schwern wrote: >> Could you delete Apache-Dispatch-0.09 from CPAN? > > done :) Thanks Geoff, I think we have a have a solid 0.10 out on CPAN. |
|
From: Geoffrey Y. <ge...@mo...> - 2008-02-11 22:53:45
|
Michael G Schwern wrote: > Could you delete Apache-Dispatch-0.09 from CPAN? done :) > It has Foo::Bar and > Foo::Foo modules indexed which are often used as gibberish module > names. I was surprised when the CPAN shell started to install > Apache::Dispatch. :) people should choose a less likely candidate, then ;) it'll be gone in a few days. --Geoff |
|
From: Fred M. <fr...@re...> - 2008-01-14 17:46:38
|
>> This will also affect stuff like Apache::SizeLimit, Peek, etc. where I >> stole this Makefile.PL from. Any thoughts course of action? > > not really :) > > if version 0 means they don't have mod_perl installed at all then it > probably doesn't matter - I argued with stas at length that the build > tools should fail-to-test-but-return-true for an incomplete environment, > but I lost that battle... hm, well I happen to agree with you that it should fail-test-but-return-true, so I'll make the necessary commit here. I don't think that we are under any license obligations here to retain the existing behavior (since we stole it from ASF code), but I'll check to make sure that's the case. thanks for the heads up :) |
|
From: Geoffrey Y. <ge...@mo...> - 2008-01-14 16:17:29
|
Fred Moyer wrote:
> ------------------------------
> PROGRAM OUTPUT
> ------------------------------
>
> Output from '/export/home/bob/cpantesting/perl-5.10.0/bin/perl Makefile.PL':
>
> don't know anything about mod_perl generation: 0
> currently supporting only generations 1 and 2 at Makefile.PL line 142.
>
>
> Here is line 142:
>
> sub satisfy_mp_generation {
> my $wanted = shift || wanted_mp_generation();
>
> unless ( $wanted == 1 || $wanted == 2 ) {
> 142 die "don't know anything about mod_perl generation: $wanted\n"
> . "currently supporting only generations 1 and 2";
> }
>
>
> This will also affect stuff like Apache::SizeLimit, Peek, etc. where I
> stole this Makefile.PL from. Any thoughts course of action?
not really :)
if version 0 means they don't have mod_perl installed at all then it
probably doesn't matter - I argued with stas at length that the build
tools should fail-to-test-but-return-true for an incomplete environment,
but I lost that battle...
--Geoff
|
|
From: Fred M. <fr...@re...> - 2008-01-12 19:59:10
|
------------------------------
PROGRAM OUTPUT
------------------------------
Output from '/export/home/bob/cpantesting/perl-5.10.0/bin/perl Makefile.PL':
don't know anything about mod_perl generation: 0
currently supporting only generations 1 and 2 at Makefile.PL line 142.
Here is line 142:
sub satisfy_mp_generation {
my $wanted = shift || wanted_mp_generation();
unless ( $wanted == 1 || $wanted == 2 ) {
142 die "don't know anything about mod_perl generation: $wanted\n"
. "currently supporting only generations 1 and 2";
}
This will also affect stuff like Apache::SizeLimit, Peek, etc. where I
stole this Makefile.PL from. Any thoughts course of action?
|
|
From: Fred M. <fr...@re...> - 2008-01-09 01:29:27
|
0.10 is out, here is the link: http://search.cpan.org/~phred/Apache-Dispatch-0.10/lib/Apache/Dispatch.pm Relevant change history: 0.10 01.08.2008 - steal the RELEASE doc from Apache::Reload and adapt it - fred - steal the Makefile.PL from A::R, and merge it with our needed custom config directive generation, it detects the version more reliably - fred 0.10_03 12.14.2007 - use the :withtestmore feature correctly - fred, thanks to geoff for the spot - use like() instead of ok( $foo =~ m/bar/ ) - fred 0.10_02 07.19.2007 - fix the unadvertised feature which allows handling <Location /> - fred 0.10_01 10.23.2006 - move common methods to Apache::Dispatch::Util and adjust @ISA for Apache*::Dispatch modules to use common methods via inheritance - fred - deprecated $Apache::Dispatch::DEBUG directive per dev notes in favor of DispatchDebug, which accepts the same arguments, see pod - fred - mod_perl2 compatibility via Apache2::Dispatch - fred - source code now under subversion at http://svn.sourceforge.net/viewcvs.cgi/apache-dispatch/ - geoff, domm - project moved to http://sourceforge.net/projects/apache-dispatch - geoff * new maintainer: Fred Moyer <fr...@re...> - pass $rc to error handler to allow for finer grained error handling - print "Using/Exiting A::D" only if $debug>=1 * new maintainer: Thomas Klausner, do...@zs... - fixed DispatchISA bug that kept adding the same classes to @ISA (Barrie Slaymaker) - fixed bug for <Location /> (thanks again to Barrie for the spot) - suggested use of NEXT.pm pseudoclass in AUTOLOAD documentation - added test suite based on Apache::Test (from 2.0) - made invoked method available from pre/post/error handlers (suggested by Tatsuhiko Miyagawa) |
|
From: <phr...@us...> - 2008-01-08 19:14:42
|
Revision: 63
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=63&view=rev
Author: phred_moyer
Date: 2008-01-08 11:14:39 -0800 (Tue, 08 Jan 2008)
Log Message:
-----------
0.10 release
Modified Paths:
--------------
trunk/Changes
trunk/MANIFEST
trunk/RELEASE
trunk/lib/Apache/Dispatch.pm
trunk/lib/Apache2/Dispatch.pm
Modified: trunk/Changes
===================================================================
--- trunk/Changes 2007-12-26 03:20:18 UTC (rev 62)
+++ trunk/Changes 2008-01-08 19:14:39 UTC (rev 63)
@@ -1,11 +1,11 @@
Revision history for Perl extension Apache::Dispatch
-0.10-dev
+0.10 01.08.2008
- steal the RELEASE doc from Apache::Reload and adapt it - fred
- steal the Makefile.PL from A::R, and merge it with our needed custom
config directive generation, it detects the version more reliably - fred
-0.10_03
+0.10_03 12.14.2007
- use the :withtestmore feature correctly - fred, thanks to geoff for the spot
- use like() instead of ok( $foo =~ m/bar/ ) - fred
Modified: trunk/MANIFEST
===================================================================
--- trunk/MANIFEST 2007-12-26 03:20:18 UTC (rev 62)
+++ trunk/MANIFEST 2008-01-08 19:14:39 UTC (rev 63)
@@ -3,6 +3,7 @@
Makefile.PL
INSTALL
README
+RELEASE
ToDo
test.pl
set_pureperl.PL
Modified: trunk/RELEASE
===================================================================
--- trunk/RELEASE 2007-12-26 03:20:18 UTC (rev 62)
+++ trunk/RELEASE 2008-01-08 19:14:39 UTC (rev 63)
@@ -6,8 +6,8 @@
a. edit ./Changes:
- find lib -type f -name "*.pm" | \
- xargs perl -pi -e 's,0.10-dev,0.10-RC1,g'
- - perl -pi -e 's,0.10-dev,0.10-RC1,g' Changes
+ xargs perl -pi -e 's,0.11-dev,0.11-RC1,g'
+ - perl -pi -e 's,0.11-dev,0.11-RC1,g' Changes
- don't commit these (see dev@ archives)
@@ -26,7 +26,7 @@
o dev/perl.apache.org
o modperl/perl.apache.org
- Subject: [RELEASE CANDIDATE] Apache-Dispatch 0.10 RC\d+
+ Subject: [RELEASE CANDIDATE] Apache-Dispatch 0.11 RC\d+
(or maybe longer to give most people a chance to catch up). no need
to tag this package
@@ -61,7 +61,7 @@
5. Announce the package
a. post ... to the modperl, announce lists
- Subject: [ANNOUNCE] Apache-Dispatch 0.10
+ Subject: [ANNOUNCE] Apache-Dispatch 0.11
include
- MD5 sig (as it comes from CPAN upload announce).
- the latest Changes
@@ -73,7 +73,7 @@
b. edit ./Changes:
- start a new item with incremented version + '-dev'
- =item 0.11-dev
+ =item 0.12-dev
c. bump up version numbers in this file to make it easier to do the
next release.
@@ -81,4 +81,4 @@
$ perl -pi -e 's/(\d+)\.(\d+)/join(".", $1, $2+1)/eg' RELEASE
d. commit Changes
- % svn ci -m "start 0.11-dev cycle" Changes RELEASE lib/Apache/Dispatch.pm
+ % svn ci -m "start 0.12-dev cycle" Changes RELEASE lib/Apache/Dispatch.pm
Modified: trunk/lib/Apache/Dispatch.pm
===================================================================
--- trunk/lib/Apache/Dispatch.pm 2007-12-26 03:20:18 UTC (rev 62)
+++ trunk/lib/Apache/Dispatch.pm 2008-01-08 19:14:39 UTC (rev 63)
@@ -11,7 +11,7 @@
use strict;
use warnings;
-our $VERSION = '0.10_02';
+our $VERSION = '0.10';
use mod_perl 1.2401;
use Apache::Constants qw(OK DECLINED SERVER_ERROR);
Modified: trunk/lib/Apache2/Dispatch.pm
===================================================================
--- trunk/lib/Apache2/Dispatch.pm 2007-12-26 03:20:18 UTC (rev 62)
+++ trunk/lib/Apache2/Dispatch.pm 2008-01-08 19:14:39 UTC (rev 63)
@@ -9,7 +9,7 @@
use strict;
use warnings;
-$Apache2::Dispatch::VERSION = '0.10_02';
+$Apache2::Dispatch::VERSION = '0.10';
use mod_perl2 1.99023;
use Apache2::Const -compile => qw(OK DECLINED SERVER_ERROR);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Fred M. <fr...@ta...> - 2008-01-03 20:13:41
|
>> It's here finally. After lunch and before christmas. Just barely >> though. >> >> http://people.apache.org/~phred/Apache-Dispatch-0.10-rc1.tgz >> >> Makefile.PL stolen from Apache::Reload and adapted. Tested LWP/(NO LWP) >> for mp1 and mp2, all tests passing. > > RC2 fixes an error introduced into Makefile.PL. If we don't have > Apache::Test installed, don't try to run any tests. > > http://people.apache.org/~phred/Apache-Dispatch-0.10-RC2.tar.gz Hey Geoff, if you have five minutes can you take this for a spin? I think I've found another bug in the code, which relates to redirects, but not sure if I can get to it for a week or so. |
|
From: Fred M. <fr...@re...> - 2007-12-26 19:53:37
|
Fred Moyer wrote: > Geoffrey Young wrote: >> Fred Moyer wrote: >>>> It's here finally. After lunch and before christmas. Just barely though. >>>> >>>> http://people.apache.org/~phred/Apache-Dispatch-0.10-rc1.tgz >>>> >>>> Makefile.PL stolen from Apache::Reload and adapted. Tested LWP/(NO LWP) >>>> for mp1 and mp2, all tests passing. >>> RC2 fixes an error introduced into Makefile.PL. If we don't have >>> Apache::Test installed, don't try to run any tests. >>> >>> http://people.apache.org/~phred/Apache-Dispatch-0.10-RC2.tar.gz >> this is not the way you are supposed to spend christmas day :) > > it's the life of a bachelor hacker :) plus, santa left a nice bag of tuits in my stocking :) |
|
From: Fred M. <fr...@ta...> - 2007-12-26 19:47:44
|
Geoffrey Young wrote: > > Fred Moyer wrote: >>> It's here finally. After lunch and before christmas. Just barely though. >>> >>> http://people.apache.org/~phred/Apache-Dispatch-0.10-rc1.tgz >>> >>> Makefile.PL stolen from Apache::Reload and adapted. Tested LWP/(NO LWP) >>> for mp1 and mp2, all tests passing. >> RC2 fixes an error introduced into Makefile.PL. If we don't have >> Apache::Test installed, don't try to run any tests. >> >> http://people.apache.org/~phred/Apache-Dispatch-0.10-RC2.tar.gz > > this is not the way you are supposed to spend christmas day :) it's the life of a bachelor hacker :) |
|
From: Geoffrey Y. <ge...@mo...> - 2007-12-26 19:45:42
|
Fred Moyer wrote: >> It's here finally. After lunch and before christmas. Just barely though. >> >> http://people.apache.org/~phred/Apache-Dispatch-0.10-rc1.tgz >> >> Makefile.PL stolen from Apache::Reload and adapted. Tested LWP/(NO LWP) >> for mp1 and mp2, all tests passing. > > RC2 fixes an error introduced into Makefile.PL. If we don't have > Apache::Test installed, don't try to run any tests. > > http://people.apache.org/~phred/Apache-Dispatch-0.10-RC2.tar.gz this is not the way you are supposed to spend christmas day :) --Geoff |
|
From: Fred M. <fr...@ta...> - 2007-12-26 03:25:35
|
> It's here finally. After lunch and before christmas. Just barely though. > > http://people.apache.org/~phred/Apache-Dispatch-0.10-rc1.tgz > > Makefile.PL stolen from Apache::Reload and adapted. Tested LWP/(NO LWP) > for mp1 and mp2, all tests passing. RC2 fixes an error introduced into Makefile.PL. If we don't have Apache::Test installed, don't try to run any tests. http://people.apache.org/~phred/Apache-Dispatch-0.10-RC2.tar.gz |
|
From: <phr...@us...> - 2007-12-26 03:20:18
|
Revision: 62
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=62&view=rev
Author: phred_moyer
Date: 2007-12-25 19:20:18 -0800 (Tue, 25 Dec 2007)
Log Message:
-----------
use upper case RC to match ASF module convention
Modified Paths:
--------------
trunk/RELEASE
Modified: trunk/RELEASE
===================================================================
--- trunk/RELEASE 2007-12-26 02:09:41 UTC (rev 61)
+++ trunk/RELEASE 2007-12-26 03:20:18 UTC (rev 62)
@@ -6,8 +6,8 @@
a. edit ./Changes:
- find lib -type f -name "*.pm" | \
- xargs perl -pi -e 's,0.10-dev,0.10-rc1,g'
- - perl -pi -e 's,0.10-dev,0.10-rc1,g' Changes
+ xargs perl -pi -e 's,0.10-dev,0.10-RC1,g'
+ - perl -pi -e 's,0.10-dev,0.10-RC1,g' Changes
- don't commit these (see dev@ archives)
@@ -37,7 +37,7 @@
package to be released
a. edit ./Changes:
- - remove -rc\d+
+ - remove -RC\d+
- add release date
b. rerun:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <phr...@us...> - 2007-12-26 02:09:39
|
Revision: 61
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=61&view=rev
Author: phred_moyer
Date: 2007-12-25 18:09:41 -0800 (Tue, 25 Dec 2007)
Log Message:
-----------
fix error in error message
Modified Paths:
--------------
trunk/Makefile.PL
Modified: trunk/Makefile.PL
===================================================================
--- trunk/Makefile.PL 2007-12-25 20:15:14 UTC (rev 60)
+++ trunk/Makefile.PL 2007-12-26 02:09:41 UTC (rev 61)
@@ -267,7 +267,7 @@
test::
\t\@echo
\t\@echo sorry, cannot run tests without a properly
-\t\@echo configured Apache-Test environment, mininum
+\t\@echo configured Apache-Test environment
\t\@echo
EOF
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <phr...@us...> - 2007-12-25 20:15:10
|
Revision: 60
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=60&view=rev
Author: phred_moyer
Date: 2007-12-25 12:15:14 -0800 (Tue, 25 Dec 2007)
Log Message:
-----------
We don't want to run any tests if Apache::Test isn't present, since all of our
tests require Apache::Test.
Modified Paths:
--------------
trunk/Makefile.PL
Modified: trunk/Makefile.PL
===================================================================
--- trunk/Makefile.PL 2007-12-25 05:21:13 UTC (rev 59)
+++ trunk/Makefile.PL 2007-12-25 20:15:14 UTC (rev 60)
@@ -263,7 +263,13 @@
return $self->Apache::TestMM::test(@_) if $HAS_APACHE_TEST;
- return $self->SUPER::test(@_);
+ return <<EOF
+test::
+\t\@echo
+\t\@echo sorry, cannot run tests without a properly
+\t\@echo configured Apache-Test environment, mininum
+\t\@echo
+EOF
}
sub clean {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Fred M. <fr...@re...> - 2007-12-25 15:52:46
|
It's here finally. After lunch and before christmas. Just barely though. http://people.apache.org/~phred/Apache-Dispatch-0.10-rc1.tgz Makefile.PL stolen from Apache::Reload and adapted. Tested LWP/(NO LWP) for mp1 and mp2, all tests passing. |
|
From: <phr...@us...> - 2007-12-25 05:21:11
|
Revision: 59
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=59&view=rev
Author: phred_moyer
Date: 2007-12-24 21:21:13 -0800 (Mon, 24 Dec 2007)
Log Message:
-----------
Steal the Makefile.PL from Apache::Reload, and merge it with the needed
custom config directive generating code.
Steal the RELEASE document also.
Modified Paths:
--------------
trunk/Changes
trunk/Makefile.PL
Added Paths:
-----------
trunk/RELEASE
Modified: trunk/Changes
===================================================================
--- trunk/Changes 2007-08-06 01:01:40 UTC (rev 58)
+++ trunk/Changes 2007-12-25 05:21:13 UTC (rev 59)
@@ -1,11 +1,16 @@
Revision history for Perl extension Apache::Dispatch
+0.10-dev
+ - steal the RELEASE doc from Apache::Reload and adapt it - fred
+ - steal the Makefile.PL from A::R, and merge it with our needed custom
+ config directive generation, it detects the version more reliably - fred
+
0.10_03
- - use the :withtestmore feature correctly
- - use like() instead of ok( $foo =~ m/bar/ )
+ - use the :withtestmore feature correctly - fred, thanks to geoff for the spot
+ - use like() instead of ok( $foo =~ m/bar/ ) - fred
0.10_02 07.19.2007
- - fix the unadvertised feature which allows handling <Location />
+ - fix the unadvertised feature which allows handling <Location /> - fred
0.10_01 10.23.2006
- move common methods to Apache::Dispatch::Util and adjust @ISA for
Modified: trunk/Makefile.PL
===================================================================
--- trunk/Makefile.PL 2007-08-06 01:01:40 UTC (rev 58)
+++ trunk/Makefile.PL 2007-12-25 05:21:13 UTC (rev 59)
@@ -1,101 +1,47 @@
package Apache::Dispatch;
-require 5.005;
-
use strict;
+use warnings;
-use lib 'lib';
+use Config;
-use Apache::Dispatch::Util;
-use ExtUtils::MakeMaker;
+my %prereqs = ();
+my %mp2 = ( mod_perl2 => 1.99022 );
+my %mp1 = ( mod_perl => 0 );
-my $HAS_APACHE_TEST = eval {
- require Apache::Test;
- require Apache::TestMM;
-
- Apache::TestMM->import(qw(test clean));
- Apache::TestMM::filter_args();
-
- my %args = @Apache::TestMM::Argv;
- return 0
- unless (
- (
- Apache::TestConfig->can('custom_config_path')
- and -f Apache::TestConfig->custom_config_path()
- )
- or $args{apxs}
- or $args{httpd}
- or $ENV{APACHE_TEST_HTTPD}
- or $ENV{APACHE_TEST_APXS}
- );
-
- Apache::TestMM::generate_script('t/TEST');
- return 1;
-};
-
-sub MY::test {
-
- eval { require Test::More } or return <<EOF;
-test::
-\t\@echo
-\t\@echo sorry, cannot run tests without Test::More
-\t\@echo
-EOF
-
- return $HAS_APACHE_TEST if $HAS_APACHE_TEST;
-
- return <<EOF
-test::
-\t\@echo
-\t\@echo sorry, cannot run tests without a properly
-\t\@echo configured Apache-Test environment
-\t\@echo
-EOF
+my $mp_gen;
+if ( $ENV{MOD_PERL_2_BUILD} ) {
+ push @ARGV, "-apxs $ENV{MP_APXS}";
+ my $mp_gen = satisfy_mp_generation(2);
}
-
-sub MY::clean {
-
- if ($HAS_APACHE_TEST) {
- require Apache::TestMM;
-
- return Apache::TestMM::clean(@_);
- }
-
- return shift->MM::clean(@_);
+else {
+ $mp_gen = satisfy_mp_generation();
}
-## which mp version ( 1.2x or 2.0.x)
-my ( $mp_wanted, $mp_ver ) = &get_mp_ver();
+%prereqs = ( $mp_gen == 1 ? %mp1 : %mp2 );
-print STDERR "Using mod_perl/$mp_ver\n\n";
+my $HAS_APACHE_TEST = check_for_apache_test();
-my %prereq = ();
+my %common_opts = (
+ PREREQ_PM => \%prereqs,
+ clean => { FILES => 't/TEST' },
+);
-my %makefile_params = ( 'VERSION' => '0.10_02', );
+if ( $mp_gen == 1 ) {
-if ( $mp_wanted == 2 ) { # mod_perl2 specific makefile
- $prereq{'mod_perl2'} = 1.99023; # this covers the naming change
- $makefile_params{'NAME'} = 'Apache2::Dispatch';
- $makefile_params{'PREREQ_PM'} = \%prereq;
+ # Build directives using xs or PerlSetVar
+ my %makefile_params = ();
- WriteMakefile(%makefile_params);
-}
-
-elsif ( $mp_wanted == 1 ) { # mod_perl1 specific makefile
eval {
require Apache::ExtUtils;
require Apache::src;
- };
+ };
- # Build directives using xs or PerlSetVar
- my $pureperl;
-
if ( $@ || $ENV{DISPATCH_PUREPERL} ) {
print
"Building without Custom Apache Directives, use 'PerlSetVar' for configuration.\n\n";
-
$makefile_params{'PL_FILES'} = { 'set_pureperl.PL' => '1' };
- $makefile_params{'C'} = [];
+ $makefile_params{'C'} = [];
}
else {
@@ -106,6 +52,8 @@
$makefile_params{'clean'} = { FILES => '*.xs*' };
import Apache::ExtUtils qw(command_table);
+ use lib 'lib';
+ require Apache::Dispatch::Util;
my @directives = Apache::Dispatch::Util->directives();
command_table( \@directives );
@@ -113,71 +61,144 @@
die "Can't find mod_perl header files installed" unless $inc;
$makefile_params{'INC'} = $inc;
}
- $makefile_params{'PREREQ_PM'} = { mod_perl => 1.2401 };
- WriteMakefile(
- NAME => __PACKAGE__,
- PREREQ_PM => \%prereq,
+
+ require ExtUtils::MakeMaker;
+ ExtUtils::MakeMaker::WriteMakefile(
+ %common_opts,
%makefile_params,
+ VERSION_FROM => "lib/Apache/Dispatch.pm",
+ NAME => "Apache::Dispatch",
+ ABSTRACT_FROM => 'lib/Apache/Dispatch.pm',
);
+
}
+else {
+ require ModPerl::MM;
+ ModPerl::MM::WriteMakefile(
+ %common_opts,
+ VERSION_FROM => "lib/Apache2/Dispatch.pm",
+ NAME => "Apache2::Dispatch",
+ ABSTRACT_FROM => 'lib/Apache2/Dispatch.pm',
+ );
+}
-# The next sub inspired by Apache::Peek 1.05
+if ( $ENV{MOD_PERL_2_BUILD} ) {
+ pop @ARGV;
+}
-sub get_mp_ver {
+sub check_for_apache_test {
+ return unless eval {
+ require Apache::Test;
+ require Apache::TestMM;
+ require Apache::TestRunPerl;
+ 1;
+ };
- my $at_ver;
- my %at_args;
- if ($HAS_APACHE_TEST) {
- %at_args = @Apache::TestMM::Argv;
- } elsif ( @ARGV ) {
- %at_args = @ARGV;
- $at_args{'httpd'} = $at_args{'-httpd'};
- $at_args{'apxs'} = $at_args{'-apxs'};
- }
+ Apache::TestMM::filter_args();
- if ( $at_args{'apxs'} && $at_args{'httpd'} ) {
+ my %args;
+ {
+ no warnings;
+ %args = @Apache::TestMM::Argv;
+ }
- # probably mp2
- ($at_ver) = `$at_args{'httpd'} -v` =~ m!Apache\/(\d{1})!;
- if ( $at_ver == 1 ) {
- die <<EOF;
-Sorry dynamic builds are not supported for mod_perl 1
-EOF
- } elsif (!$at_ver) {
- die <<EOF;
-Couldn't determine an apache version from your -httpd argument
-EOF
- }
- }
- elsif ( $at_args{'httpd'} ) {
+ return 0
+ unless (
+ (
+ Apache::TestConfig->can('custom_config_path')
+ and -f Apache::TestConfig->custom_config_path()
+ )
+ or $args{apxs}
+ or $args{httpd}
+ or $ENV{APACHE_TEST_HTTPD}
+ or $ENV{APACHE_TEST_APXS}
+ );
- # probably mp1
- ($at_ver) = `$at_args{'httpd'} -v` =~ m!Apache\/(\d{1})!;
- if ( $at_ver == 2 ) { # static build for mp2 not supported
- die <<EOF;
-You specified -httpd, and httpd version is 2, but static
-builds in mp2 are not yet supported. Please see INSTALL
-or specify a -apxs /path/to/apxs option.
-EOF
+ Apache::TestRunPerl->generate_script();
+
+ return 1;
+}
+
+# If a specific generation was passed as an argument,
+# if satisfied
+# return the same generation
+# else
+# die
+# else @ARGV and %ENV will be checked for specific orders
+# if the specification will be found
+# if satisfied
+# return the specified generation
+# else
+# die
+# else if any mp generation is found
+# return it
+# else
+# die
+
+sub satisfy_mp_generation {
+ my $wanted = shift || wanted_mp_generation();
+
+ unless ( $wanted == 1 || $wanted == 2 ) {
+ die "don't know anything about mod_perl generation: $wanted\n"
+ . "currently supporting only generations 1 and 2";
+ }
+
+ my $selected = 0;
+
+ if ( $wanted == 1 ) {
+ require_mod_perl();
+ if ( $mod_perl::VERSION >= 1.99 ) {
+
+ # so we don't pick 2.0 version if 1.0 is wanted
+ die "You don't seem to have mod_perl 1.0 installed";
}
- unless ( $at_ver == 1 ) {
- die <<EOF;
-Couldn't determine an apache version from your -httpd argument
-EOF
- }
- }
+ $selected = 1;
+ }
+ elsif ( $wanted == 2 ) {
+
+ #warn "Looking for mod_perl 2.0";
+ require_mod_perl();
+ if ( $mod_perl::VERSION < 2.0 ) {
+ die "You don't seem to have mod_perl 2.0 installed";
+ }
+ $selected = 2;
+ }
+ else {
+ require_mod_perl();
+ $selected = $mod_perl::VERSION >= 1.99 ? 2 : 1;
+ warn "Using $mod_perl::VERSION\n";
+ }
+
+ return $selected;
+}
+
+sub require_mod_perl {
+ eval { require mod_perl };
+ eval { require mod_perl2 } if ($@);
+ die "Can't find mod_perl installed\nThe error was: $@" if $@;
+}
+
+# the function looks at %ENV and Makefile.PL option to figure out
+# whether a specific mod_perl generation was requested.
+# It uses the following logic:
+# via options:
+# perl Makefile.PL MOD_PERL=2
+# or via %ENV:
+# env MOD_PERL=1 perl Makefile.PL
+#
+# return value is:
+# 1 or 2 if the specification was found (mp 1 and mp 2 respectively)
+# 0 otherwise
+sub wanted_mp_generation {
+
+ # check if we have a command line specification
+ # flag: 0: unknown, 1: mp1, 2: mp2
my $flag = 0;
- my @args = ();
-
- while ( my $arg = shift @ARGV ) {
- if ( $arg =~ /^MOD_PERL=([12])$/ ) {
+ foreach my $key (@ARGV) {
+ if ( $key =~ /^MOD_PERL=(\d)$/ ) {
$flag = $1;
}
- else {
- push @args, $arg;
- }
}
- @ARGV = @args;
# check %ENV
my $env = exists $ENV{MOD_PERL} ? $ENV{MOD_PERL} : 0;
@@ -192,59 +213,63 @@
EOF
}
- my $wanted;
- $wanted = 2 if $env == 2 || $flag == 2 || $at_ver == 2;
- $wanted = 1 if $env == 1 || $flag == 1 || $at_ver == 1;
+ my $wanted = 0;
+ $wanted = 2 if $env == 2 || $flag == 2;
+ $wanted = 1 if $env == 1 || $flag == 1;
unless ($wanted) {
# if still unknown try to require mod_perl.pm
- eval { require mod_perl2 };
+ eval { require mod_perl };
if ($@) {
# if we don't have mp1, check for mp2
- eval { require mod_perl } if ($@);
+ eval { require mod_perl2 } if ($@);
unless ($@) {
- $wanted = 1;
+ $wanted = 2;
}
}
else {
- $wanted = 2;
+ $wanted = 1;
}
}
- if ( !$wanted ) {
- die "can't determine your mod_perl version, see INSTALL\n";
- }
- elsif ( !( $wanted == 1 || $wanted == 2 ) ) {
- die "don't know anything about mod_perl generation: $wanted\n"
- . "currently supporting only generations 1 and 2";
- }
+ return $wanted;
+}
- my $mp_ver;
+package MY;
- if ( $wanted == 2 ) {
- eval { require mod_perl2 };
- my $req_ver = 1.999022;
- if ( $mod_perl2::VERSION < $req_ver || $@ ) {
- die
-"mod_perl2 required version is $req_ver, you have $mod_perl2::VERSION. Please upgrade to continue.";
- }
- else {
- $mp_ver = $mod_perl2::VERSION;
- }
- }
- elsif ( $wanted == 1 ) {
- eval { require mod_perl };
- no warnings qw(uninitialized);
- if ( $@ ) {
- die "You don't seem to have mod_perl 1.0 installed, see INSTALL\n";
- }
- else {
- $mp_ver = $mod_perl::VERSION;
- }
- }
+sub postamble {
+ my $self = shift;
- return ( $wanted, $mp_ver );
+ my $string = $self->SUPER::postamble;
+
+ $string .= <<'EOF';
+tag :
+ svn copy https://apache-dispatch.svn.sourceforge.net/svnroot/apache-dispatch/trunk https://apache-dispatch.svn.sourceforge.net/svnroot/apache-dispatch/tags/$(VERSION_SYM)
+ @echo update lib/Apache/Dispatch.pm VERSION now
+EOF
+
+ return $string;
}
+sub test {
+ my $self = shift;
+
+ eval { require Test::More } or return <<EOF;
+test::
+\t\@echo sorry, cannot run tests without Test::More
+EOF
+
+ return $self->Apache::TestMM::test(@_) if $HAS_APACHE_TEST;
+
+ return $self->SUPER::test(@_);
+}
+
+sub clean {
+ my $self = shift;
+
+ return $self->Apache::TestMM::clean(@_) if $HAS_APACHE_TEST;
+
+ return $self->SUPER::clean(@_);
+}
Added: trunk/RELEASE
===================================================================
--- trunk/RELEASE (rev 0)
+++ trunk/RELEASE 2007-12-25 05:21:13 UTC (rev 59)
@@ -0,0 +1,84 @@
+Instructions for Apache-Dispatch Release Manager
+
+1. 'make dist' - to make sure nothing is missing from the manifest,
+ etc. Now test this generated package (not svn) with as many
+ configurations as possible on as many platforms as possible.
+
+ a. edit ./Changes:
+ - find lib -type f -name "*.pm" | \
+ xargs perl -pi -e 's,0.10-dev,0.10-rc1,g'
+ - perl -pi -e 's,0.10-dev,0.10-rc1,g' Changes
+
+ - don't commit these (see dev@ archives)
+
+ b. nuke any preinstalled Apache-Dispatch libs and run 'make test'
+
+ c. test that you can 'make install' and then run 'make test' again
+
+ d. test whether we still 100% OK on systems with no LWP:
+
+ % APACHE_TEST_PRETEND_NO_LWP=1 make test
+
+2. once confident that the package is good, upload a release candidate
+ to people.apache.org/~username and post 24 hour-ish candidate alert
+ to the various lists
+
+ o dev/perl.apache.org
+ o modperl/perl.apache.org
+
+ Subject: [RELEASE CANDIDATE] Apache-Dispatch 0.10 RC\d+
+
+ (or maybe longer to give most people a chance to catch up). no need
+ to tag this package
+
+ a. if problems are detected during stage 2, repeat stages 1 and 2.
+
+3. when the package has been reported to be good, prepare a new
+ package to be released
+
+ a. edit ./Changes:
+ - remove -rc\d+
+ - add release date
+
+ b. rerun:
+ % perl Makefile.PL
+ make sure tag looks right
+ % make -n tag
+
+ c. commit Changes
+ % svn ci Changes
+
+ d. tag
+ % make tag
+
+ e. create the final package
+ % make dist
+
+ f. test the final package again at least once
+
+4. Upload the package to CPAN
+
+5. Announce the package
+
+ a. post ... to the modperl, announce lists
+ Subject: [ANNOUNCE] Apache-Dispatch 0.10
+ include
+ - MD5 sig (as it comes from CPAN upload announce).
+ - the latest Changes
+
+6. Prepare for the next cycle
+
+ a. increment version in lib/Apache/Dispatch.pm
+
+ b. edit ./Changes:
+ - start a new item with incremented version + '-dev'
+
+ =item 0.11-dev
+
+ c. bump up version numbers in this file to make it easier to do the
+ next release.
+
+ $ perl -pi -e 's/(\d+)\.(\d+)/join(".", $1, $2+1)/eg' RELEASE
+
+ d. commit Changes
+ % svn ci -m "start 0.11-dev cycle" Changes RELEASE lib/Apache/Dispatch.pm
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <phr...@us...> - 2007-08-06 01:01:39
|
Revision: 58
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=58&view=rev
Author: phred_moyer
Date: 2007-08-05 18:01:40 -0700 (Sun, 05 Aug 2007)
Log Message:
-----------
Remove test::more, missed from commit 57
Modified Paths:
--------------
trunk/t/04oo.t
Modified: trunk/t/04oo.t
===================================================================
--- trunk/t/04oo.t 2007-08-06 00:05:58 UTC (rev 57)
+++ trunk/t/04oo.t 2007-08-06 01:01:40 UTC (rev 58)
@@ -3,7 +3,6 @@
use Apache::Test qw( -withtestmore );
use Apache::TestRequest qw(GET);
-use Test::More;
plan tests => 2, need_lwp;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Fred M. <fr...@re...> - 2007-08-06 00:10:26
|
Geoffrey Young wrote: >> -use Apache::Test qw(ok plan :withtestmore ); >> +use Apache::Test qw( :withtestmore ); >> use Apache::TestRequest qw(GET); >> +use Test::More; >> >> plan tests => 5, need_lwp; > > I'm pretty sure you want -withtestmore here - IIRC, :withtestmore gives > you Test::More symbols, in which case plan() is Test::More::plan() and > doesn't recognize the optional parameters, whereas the -withtestmore > action is more dwimmy. > > sorry for the confusion, especially if my memory is cloudy :) No worries, thanks for the spot! I went back and read through the Apache::Test docs when I first did this and they seemed to suggest that :withtestmore is the correct choice for client side tests. After your suggestion and rereading it though, I don't see a case where you would ever want :withtestmore instead of -withtestmore. I guess it was a bit unclear for me, thanks for the spot. |
|
From: <phr...@us...> - 2007-08-06 00:05:55
|
Revision: 57
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=57&view=rev
Author: phred_moyer
Date: 2007-08-05 17:05:58 -0700 (Sun, 05 Aug 2007)
Log Message:
-----------
Use -withtestmore instead of :withtestmore. The apache::test documentation
seemed to suggest that -withtestmore was for server-based tests, but it
looks like using it for client side tests allows us to avoid the extra
call to 'use Test::More'. Thanks to Geoff for the spot.
Modified Paths:
--------------
trunk/t/01plain.t
trunk/t/02extras.t
trunk/t/03filter.t
trunk/t/04oo.t
Modified: trunk/t/01plain.t
===================================================================
--- trunk/t/01plain.t 2007-08-05 21:04:57 UTC (rev 56)
+++ trunk/t/01plain.t 2007-08-06 00:05:58 UTC (rev 57)
@@ -1,9 +1,8 @@
use strict;
use warnings FATAL => 'all';
-use Apache::Test qw( :withtestmore );
+use Apache::Test qw( -withtestmore );
use Apache::TestRequest qw(GET GET_OK);
-use Test::More;
plan tests => 5, need_lwp;
Modified: trunk/t/02extras.t
===================================================================
--- trunk/t/02extras.t 2007-08-05 21:04:57 UTC (rev 56)
+++ trunk/t/02extras.t 2007-08-06 00:05:58 UTC (rev 57)
@@ -1,9 +1,8 @@
use strict;
use warnings FATAL => 'all';
-use Apache::Test qw( :withtestmore );
+use Apache::Test qw( -withtestmore );
use Apache::TestRequest qw(GET);
-use Test::More;
plan tests => 5, need_lwp;
Modified: trunk/t/03filter.t
===================================================================
--- trunk/t/03filter.t 2007-08-05 21:04:57 UTC (rev 56)
+++ trunk/t/03filter.t 2007-08-06 00:05:58 UTC (rev 57)
@@ -1,9 +1,8 @@
use strict;
use warnings FATAL => 'all';
-use Apache::Test qw( :withtestmore );
+use Apache::Test qw( -withtestmore );
use Apache::TestRequest qw(GET);
-use Test::More;
# figure out what version of apache we have we have
my $httpd = Apache::Test::vars('httpd');
Modified: trunk/t/04oo.t
===================================================================
--- trunk/t/04oo.t 2007-08-05 21:04:57 UTC (rev 56)
+++ trunk/t/04oo.t 2007-08-06 00:05:58 UTC (rev 57)
@@ -1,7 +1,7 @@
use strict;
use warnings FATAL => 'all';
-use Apache::Test qw(:withtestmore );
+use Apache::Test qw( -withtestmore );
use Apache::TestRequest qw(GET);
use Test::More;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Geoffrey Y. <ge...@mo...> - 2007-08-05 23:57:36
|
> -use Apache::Test qw(ok plan :withtestmore ); > +use Apache::Test qw( :withtestmore ); > use Apache::TestRequest qw(GET); > +use Test::More; > > plan tests => 5, need_lwp; I'm pretty sure you want -withtestmore here - IIRC, :withtestmore gives you Test::More symbols, in which case plan() is Test::More::plan() and doesn't recognize the optional parameters, whereas the -withtestmore action is more dwimmy. sorry for the confusion, especially if my memory is cloudy :) --Geoff |
|
From: <phr...@us...> - 2007-08-05 21:04:55
|
Revision: 56
http://apache-dispatch.svn.sourceforge.net/apache-dispatch/?rev=56&view=rev
Author: phred_moyer
Date: 2007-08-05 14:04:57 -0700 (Sun, 05 Aug 2007)
Log Message:
-----------
- correctly use the :withtestmore feature instead of my atrocious hack
- actually commit the version updates for 10_02 (my bad)
- since we are using Test::More, take advantage of like() and cmp_ok()
Modified Paths:
--------------
trunk/Changes
trunk/Makefile.PL
trunk/lib/Apache/Dispatch.pm
trunk/lib/Apache2/Dispatch.pm
trunk/t/01plain.t
trunk/t/02extras.t
trunk/t/03filter.t
trunk/t/04oo.t
Modified: trunk/Changes
===================================================================
--- trunk/Changes 2007-07-20 06:41:37 UTC (rev 55)
+++ trunk/Changes 2007-08-05 21:04:57 UTC (rev 56)
@@ -1,5 +1,9 @@
Revision history for Perl extension Apache::Dispatch
+0.10_03
+ - use the :withtestmore feature correctly
+ - use like() instead of ok( $foo =~ m/bar/ )
+
0.10_02 07.19.2007
- fix the unadvertised feature which allows handling <Location />
Modified: trunk/Makefile.PL
===================================================================
--- trunk/Makefile.PL 2007-07-20 06:41:37 UTC (rev 55)
+++ trunk/Makefile.PL 2007-08-05 21:04:57 UTC (rev 56)
@@ -71,7 +71,7 @@
my %prereq = ();
-my %makefile_params = ( 'VERSION' => '0.10_01', );
+my %makefile_params = ( 'VERSION' => '0.10_02', );
if ( $mp_wanted == 2 ) { # mod_perl2 specific makefile
$prereq{'mod_perl2'} = 1.99023; # this covers the naming change
Modified: trunk/lib/Apache/Dispatch.pm
===================================================================
--- trunk/lib/Apache/Dispatch.pm 2007-07-20 06:41:37 UTC (rev 55)
+++ trunk/lib/Apache/Dispatch.pm 2007-08-05 21:04:57 UTC (rev 56)
@@ -11,7 +11,7 @@
use strict;
use warnings;
-our $VERSION = '0.10_01';
+our $VERSION = '0.10_02';
use mod_perl 1.2401;
use Apache::Constants qw(OK DECLINED SERVER_ERROR);
Modified: trunk/lib/Apache2/Dispatch.pm
===================================================================
--- trunk/lib/Apache2/Dispatch.pm 2007-07-20 06:41:37 UTC (rev 55)
+++ trunk/lib/Apache2/Dispatch.pm 2007-08-05 21:04:57 UTC (rev 56)
@@ -9,7 +9,7 @@
use strict;
use warnings;
-$Apache2::Dispatch::VERSION = '0.10_01';
+$Apache2::Dispatch::VERSION = '0.10_02';
use mod_perl2 1.99023;
use Apache2::Const -compile => qw(OK DECLINED SERVER_ERROR);
Modified: trunk/t/01plain.t
===================================================================
--- trunk/t/01plain.t 2007-07-20 06:41:37 UTC (rev 55)
+++ trunk/t/01plain.t 2007-08-05 21:04:57 UTC (rev 56)
@@ -1,8 +1,9 @@
use strict;
use warnings FATAL => 'all';
-use Apache::Test qw(ok plan :withtestmore );
+use Apache::Test qw( :withtestmore );
use Apache::TestRequest qw(GET GET_OK);
+use Test::More;
plan tests => 5, need_lwp;
Modified: trunk/t/02extras.t
===================================================================
--- trunk/t/02extras.t 2007-07-20 06:41:37 UTC (rev 55)
+++ trunk/t/02extras.t 2007-08-05 21:04:57 UTC (rev 56)
@@ -1,19 +1,20 @@
use strict;
use warnings FATAL => 'all';
-use Apache::Test qw(ok plan :withtestmore );
+use Apache::Test qw( :withtestmore );
use Apache::TestRequest qw(GET);
+use Test::More;
plan tests => 5, need_lwp;
my $uri = '/extras';
my $res = GET $uri;
-ok $res->code == 200;
-ok $res->content =~ m/post_dispatch/;
-ok $res->content =~ m/pre_dispatch/;
+cmp_ok($res->code, '==', 200);
+like($res->content, qr/post_dispatch/);
+like($res->content, qr/pre_dispatch/);
$uri = '/extras/bad';
$res = GET $uri;
-ok $res->code == 200;
-ok $res->content =~ m/Yikes(.*?)dispatch_error/i;
+cmp_ok($res->code, '==', 200);
+like($res->content, qr/Yikes(.*?)dispatch_error/i, 'content like Yikes');
Modified: trunk/t/03filter.t
===================================================================
--- trunk/t/03filter.t 2007-07-20 06:41:37 UTC (rev 55)
+++ trunk/t/03filter.t 2007-08-05 21:04:57 UTC (rev 56)
@@ -1,8 +1,9 @@
use strict;
use warnings FATAL => 'all';
-use Apache::Test qw(ok plan :withtestmore );
+use Apache::Test qw( :withtestmore );
use Apache::TestRequest qw(GET);
+use Test::More;
# figure out what version of apache we have we have
my $httpd = Apache::Test::vars('httpd');
@@ -28,4 +29,4 @@
my $res = GET $url;
ok( $res->is_success );
-ok( $res->content =~ m/dispatchfoo/i );
+like( $res->content, qr/dispatch_foo/i, 'content like dispatch_foo' );
Modified: trunk/t/04oo.t
===================================================================
--- trunk/t/04oo.t 2007-07-20 06:41:37 UTC (rev 55)
+++ trunk/t/04oo.t 2007-08-05 21:04:57 UTC (rev 56)
@@ -1,8 +1,9 @@
use strict;
use warnings FATAL => 'all';
-use Apache::Test qw(ok plan :withtestmore );
+use Apache::Test qw(:withtestmore );
use Apache::TestRequest qw(GET);
+use Test::More;
plan tests => 2, need_lwp;
@@ -10,4 +11,4 @@
my $res = GET $url;
ok($res->is_success);
-ok($res->content =~ m/dispatch_baz/i);
+like($res->content, qr/dispatch_baz/i, 'content like dispatch_baz');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|