Author: phred Date: Mon Apr 6 04:27:14 2009 New Revision: 762204 URL: http://svn.apache.org/viewvc?rev=762204&view=rev Log: Fix documentation errors, and find subtle bug where mp1 was looking for mod_perl1.pm. Simplify this by using distinct monikers mod_perl and mod_perl2 instead of trying to use mod_perl1.
Modified: perl/Apache-Bootstrap/trunk/Changes perl/Apache-Bootstrap/trunk/README perl/Apache-Bootstrap/trunk/lib/Apache/Bootstrap.pm perl/Apache-Bootstrap/trunk/t/00-load.t Modified: perl/Apache-Bootstrap/trunk/Changes URL: http://svn.apache.org/viewvc/perl/Apache-Bootstrap/trunk/Changes?rev=762204&r1=762203&r2=762204&view=diff ============================================================================== --- perl/Apache-Bootstrap/trunk/Changes (original) +++ perl/Apache-Bootstrap/trunk/Changes Mon Apr 6 04:27:14 2009 @@ -1,5 +1,8 @@ Revision history for Apache-Bootstrap +0.06-dev + - replace confusing instances of mod_perl1 and mp1 with simply mod_perl + 0.05 Mon Mar 30 10:25:54 PST 2009 - change apache test check for wrong version instead of valid a:t config Modified: perl/Apache-Bootstrap/trunk/README URL: http://svn.apache.org/viewvc/perl/Apache-Bootstrap/trunk/README?rev=762204&r1=762203&r2=762204&view=diff ============================================================================== --- perl/Apache-Bootstrap/trunk/README (original) +++ perl/Apache-Bootstrap/trunk/README Mon Apr 6 04:27:14 2009 @@ -1,5 +1,5 @@ NAME - Apache::Bootstrap - Bootstraps dual life mod_perl1 and mod_perl2 Apache + Apache::Bootstrap - Bootstraps dual life mod_perl and mod_perl2 Apache modules SYNOPSIS @@ -11,7 +11,8 @@ BEGIN { # make sure we have at least one minimum version required - $bootstrap = Apache::Bootstrap->new({ mp2 => '1.99022', mp1 => 0, }); + $bootstrap = Apache::Bootstrap->new({ mod_perl2 => '1.99022', + mod_perl => 0, }); } # write the Makefile using a mod_perl version dependent build subsystem @@ -42,7 +43,7 @@ # try to find these versions of mod_perl, die if none are found $bootstrap = Apache::Bootstrap->new({ mod_perl2 => 1.99022, # after mp2 renaming - mod_perl1 => 0, # any verison of mp1 + mod_perl => 0, # any version of mp1 }); mp_prereqs() Modified: perl/Apache-Bootstrap/trunk/lib/Apache/Bootstrap.pm URL: http://svn.apache.org/viewvc/perl/Apache-Bootstrap/trunk/lib/Apache/Bootstrap.pm?rev=762204&r1=762203&r2=762204&view=diff ============================================================================== --- perl/Apache-Bootstrap/trunk/lib/Apache/Bootstrap.pm (original) +++ perl/Apache-Bootstrap/trunk/lib/Apache/Bootstrap.pm Mon Apr 6 04:27:14 2009 @@ -5,11 +5,11 @@ =head1 NAME -Apache::Bootstrap - Bootstraps dual life mod_perl1 and mod_perl2 Apache modules +Apache::Bootstrap - Bootstraps dual life mod_perl and mod_perl2 Apache modules =cut -our $VERSION = '0.05'; +our $VERSION = '0.06-dev'; use constant MIN_MP2_VER => '1.99022'; # mp2 renaming @@ -23,10 +23,10 @@ BEGIN { # check to make sure we have mod_perl 1 installed - $bootstrap = Apache::Bootstrap->new({ mp1 => 0 }); + $bootstrap = Apache::Bootstrap->new({ mod_perl => 0 }); # or check for mod_perl 2 - $bootstrap = Apache::Bootstrap->new({ mp2 => '1.99022' }); + $bootstrap = Apache::Bootstrap->new({ mod_perl2 => '1.99022' }); } # check for Apache::Test, return the installed version if exists @@ -54,11 +54,11 @@ =head1 DESCRIPTION -Writing modules for mod_perl that work under both mod_perl1 and mod_perl2 is not fun. +Writing modules for mod_perl that work under both mod_perl and mod_perl2 is not fun. This module is here to make that endeavour less painful. mod_perl2 is great, but -a lot of users are still using mod_perl1. Migrating to mod_perl2 while maintaining -mod_perl1 compatibility isn't easy, and this module is here to make that transition +a lot of users are still using mod_perl. Migrating to mod_perl2 while maintaining +mod_perl compatibility isn't easy, and this module is here to make that transition as painless as possible. =head1 METHODS @@ -68,7 +68,7 @@ # try to find these versions of mod_perl, die if none are found $bootstrap = Apache::Bootstrap->new({ mod_perl2 => 1.99022, # after mp2 renaming - mod_perl1 => 0, # any verison of mp1 + mod_perl => 0, # any verison of mp1 }); =cut @@ -79,10 +79,10 @@ die 'perldoc Apache::Bootstrap' unless $args && ref $args eq 'HASH' - && ( defined $args->{mod_perl1} or defined $args->{mod_perl2} ); + && ( defined $args->{mod_perl} or defined $args->{mod_perl} ); my %self; - if ( defined $args->{mod_perl1} ) { + if ( defined $args->{mod_perl} ) { # delete mp2 from inc first, note that we don't delete mod_perl2.pm delete $INC{'mod_perl.pm'}; @@ -91,21 +91,21 @@ eval { require mod_perl }; if ($@) { - die 'mod_perl1 not present, cannot bootstrap mp1: ' . $@ if $@; + die 'mod_perl not present, cannot bootstrap mp1: ' . $@ if $@; } - elsif (( $mod_perl::VERSION < $args->{mod_perl1} ) + elsif (( $mod_perl::VERSION < $args->{mod_perl} ) or ( $mod_perl::VERSION >= MIN_MP2_VER ) ) { - die sprintf( "mod_perl1 version %s not found, we have %s", - $args->{mod_perl1}, $mod_perl::VERSION ); + die sprintf( "mod_perl version %s not found, we have %s", + $args->{mod_perl}, $mod_perl::VERSION ); } else { # store the version we have - $self{mod_perl1} = $mod_perl::VERSION; + $self{mod_perl} = $mod_perl::VERSION; } } @@ -135,7 +135,7 @@ # make sure that we have at least one mod_perl version present die "no versions of mod_perl could be found matching your constraints\n" - unless ( defined $self{mod_perl1} or defined $self{mod_perl2} ); + unless ( defined $self{mod_perl} or defined $self{mod_perl2} ); bless \%self, $class; @@ -152,7 +152,7 @@ my $self = shift; return { map { $_ => $self->{$_} } - grep { /^mod_perl[12]$/ } keys %{$self} + grep { /^mod_perl2?$/ } keys %{$self} }; } Modified: perl/Apache-Bootstrap/trunk/t/00-load.t URL: http://svn.apache.org/viewvc/perl/Apache-Bootstrap/trunk/t/00-load.t?rev=762204&r1=762203&r2=762204&view=diff ============================================================================== --- perl/Apache-Bootstrap/trunk/t/00-load.t (original) +++ perl/Apache-Bootstrap/trunk/t/00-load.t Mon Apr 6 04:27:14 2009 @@ -18,7 +18,7 @@ ); # try bootstrapping just mp1 - $mp1_bootstrap = eval { $pkg->new( { mod_perl1 => 0 } ) }; + $mp1_bootstrap = eval { $pkg->new( { mod_perl => 0 } ) }; $skip_mp1 = $@ if $@; SKIP: { @@ -41,7 +41,7 @@ skip "Skipping dual bootstrap", 2 if ( $skip_mp1 or $skip_mp2 ); $dual_bootstrap = - eval { $pkg->new( { mod_perl1 => 0, mod_perl2 => 1.99022 } ); }; + eval { $pkg->new( { mod_perl => 0, mod_perl2 => 1.99022 } ); }; # this should not throw an exception since individual bootstraps worked ok( !$@, 'no exception thrown for dual bootstrap: ' . $@ );