perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Moyer <f...@redhotpenguin.com>
Subject Hacking away - changes coming
Date Fri, 15 Oct 2010 04:22:14 GMT
Long email - read for the full diff.  I'm getting all tests passing on
these changes.  Changes entries inline.

phred@pooky ~/dev/svn/modperl/mod_perl-2.0 $ svn status
X       docs
?       CONTRIBUTORS
?       SUPPORT
?       install-pl
X       Apache-Reload
X       Apache-SizeLimit
X       Apache-Test
M       RELEASE
M       META.yml
M       Makefile.PL
M       xs/maps/apache2_functions.map
M       xs/Apache2/URI/Apache2__URI.h
M       README
?       t/modperl/stdfd2.t
?       t/modperl/stdfd.t
M       lib/ModPerl/BuildOptions.pm
M       INSTALL
M       Changes

Performing status on external item at 'Apache-Test'
?       Apache-Test/blib
D       Apache-Test/install-pl
M       Apache-Test/Makefile.PL
M       Apache-Test/lib/Apache/TestConfigPerl.pm
M       Apache-Test/lib/Apache/TestConfig.pm
M       Apache-Test/Changes

Performing status on external item at 'Apache-Reload'
?       Apache-Reload/pm_to_blib
?       Apache-Reload/blib
?       Apache-Reload/Makefile.old
?       Apache-Reload/Makefile
?       Apache-Reload/t/TEST
?       Apache-Reload/t/htdocs
?       Apache-Reload/t/logs
?       Apache-Reload/t/conf/apache_test_config.pm
?       Apache-Reload/t/conf/modperl_inc.pl
?       Apache-Reload/t/conf/httpd.conf
?       Apache-Reload/t/conf/extra.last.conf
?       Apache-Reload/t/conf/modperl_startup.pl
M       Apache-Reload/Makefile.PL
M       Apache-Reload/Changes

Performing status on external item at 'Apache-SizeLimit'
?       Apache-SizeLimit/Apache2-SizeLimit-0.91-dev.tar.gz
M       Apache-SizeLimit/Makefile.PL

Performing status on external item at 'docs'


MOD_PERL DIFF STARTS HERE


Index: Makefile.PL
===================================================================
--- Makefile.PL	(revision 997487)
+++ Makefile.PL	(working copy)
@@ -629,13 +629,6 @@
 use constant WIN32 => $^O eq 'MSWin32';
 use constant BUILD_APREXT => Apache2::Build::BUILD_APREXT;

-my $apache_test_install;
-BEGIN {
-    $apache_test_install = -e 'Apache-Test';
-    use lib './Apache-Test';
-    require 'install-pl' if $apache_test_install;
-}
-
 sub MY::top_targets {
     my $self = shift;
     my $string = $self->ModPerl::BuildMM::MY::top_targets;
@@ -729,9 +722,6 @@

 EOF

-    $string .= Apache::Test::install::nuke_Apache__test_target()
-        if $apache_test_install;
-
     $string;
 }

@@ -747,9 +737,6 @@
 	# ModPerl::MM::add_dep(\$string, "pure${kind}_install" => 'aprext_install')
 	#    if BUILD_APREXT;

-	ModPerl::MM::add_dep(\$string, "pure${kind}_install" => 'nuke_Apache__test')
-	    if $apache_test_install;
-
 	ModPerl::MM::add_dep_after(\$string, "install$kind",
"doc${kind}_install", 'modperl_banner');

 	# glue_pods target must come first
Index: Changes
===================================================================
--- Changes	(revision 997487)
+++ Changes	(working copy)
@@ -12,6 +12,9 @@

 =item 2.0.5-dev

+Remove Apache::test compatibility (part of mod_perl 1.2.7)
+[Phred]
+
 Make sure perl is built either with multiplicity and ithreads or without
 both [Theory, Torsten]

Index: lib/ModPerl/BuildOptions.pm
===================================================================
--- lib/ModPerl/BuildOptions.pm	(revision 1002862)
+++ lib/ModPerl/BuildOptions.pm	(working copy)
@@ -66,6 +66,23 @@
     $build->{MP_COMPAT_1X} = 1
         unless exists $build->{MP_COMPAT_1X} && !$build->{MP_COMPAT_1X};

+    # make a last ditch effort to find apxs in $ENV{PATH}
+    if (!$build->{MP_AP_PREFIX} && !$build->{MP_APXS}) {
+
+        my @paths = split(/:/, $ENV{PATH});
+        my $potential_apxs;
+        while (!$potential_apxs) {
+
+            $potential_apxs = File::Spec->catfile(shift @paths, 'apxs');
+            if (-e $potential_apxs && -x $potential_apxs) {
+
+                $build->{MP_APXS} = $potential_apxs;
+                print "MP_APXS unspecified, using $potential_apxs\n\n";
+            } else {
+                undef $potential_apxs;
+            }
+        }
+    }
 }

 sub parse {


APACHE-TEST DIFF

Index: install-pl
===================================================================
--- install-pl	(revision 1022724)
+++ install-pl	(working copy)
@@ -1,67 +0,0 @@
-# this is just a helper module for the installation phase, so it can
-# be re-used during the standalone and mod_perl 2.0 install
-
-# it has this unusual filename: install-pl, to prevent MakeMaker from
-# installing it system-wide
-package Apache::Test::install;
-
-use strict;
-use warnings;
-
-use File::Spec::Functions qw(catfile catdir);
-
-# on Case-Insensitive systems Apache/Test.pm can't coexist with
-# Apache/test.pm, since Apache::test is now deprecated (was renamed to
-# Apache/testold.pm in mod_perl 1.28, we need to find and remove any
-# occurrences of this file. CPAN authors should
-# s/Apache::test/Apache::testold/ and can either require mod_perl 1.28
-# which already carries it or simply bundle it. The best option is to
-# port the test suite to use Apache::Test which works with both
-# mod_perl generations.
-#
-# we could have done this cleanup only for case-insensitive systems,
-# but I feel that doing it for all systems, will speedup the
-# transitions from Apache::test to either Apache::Test or
-# Apache::testold.
-#
-sub nuke_Apache__test_target {
-
-    my $cleanup_packlist = ".mypacklist";
-
-    my @convicts = ();
-    foreach (@INC) {
-        my $dir = catdir $_, "Apache";
-        next unless -d $dir;
-        opendir DIR, $dir or die "Cannot opendir $dir: $!\n";
-        my @matches = grep /^test.pm$/, readdir DIR;
-        closedir DIR;
-        push @convicts, map { catfile $dir, $_ } @matches if @matches;
-    }
-
-    if (@convicts) {
-        print <<EOI;
-!!! Makefile.PL has found old copies of Apache/test.pm which will
-be removed during 'make install' to prevent collisions with Apache::Test:
-
-@{[join "\n", @convicts]}
-
-CPAN authors are advised to either use Apache::testold or port their
-test suite to Apache::Test which works with both mod_perl generations.
-EOI
-    }
-
-    open PACKLIST, ">$cleanup_packlist"
-        or die "Can't open $cleanup_packlist: $!";
-    print PACKLIST join "", map "$_\n", @convicts;
-    close PACKLIST;
-
-    return <<EOF;
-
-nuke_Apache__test:
-\t\$(FULLPERL) -MExtUtils::Install -e \\
-\t"-e qq{$cleanup_packlist} && uninstall(qq{$cleanup_packlist}, 1, 0)"
-EOF
-
-}
-
-1;
Index: Makefile.PL
===================================================================
--- Makefile.PL	(revision 1022724)
+++ Makefile.PL	(working copy)
@@ -8,7 +8,7 @@

 # was this file invoked directly via perl, or via the top-level
 # (mp2) Makefile.PL? if top-level, this env var will be set
-use constant TOP_LEVEL => !exists $ENV{MOD_PERL_2_BUILD};
+use constant TOP_LEVEL => $ENV{MOD_PERL_2_BUILD};

 use ExtUtils::MakeMaker;
 use Symbol;
@@ -24,8 +24,6 @@
 my $VERSION;
 set_version();

-sanity_check();
-
 Apache::TestMM::filter_args();

 my @scripts = qw(t/TEST);
@@ -52,13 +50,6 @@
 }
 Apache::TestReport->generate_script;

-# if built with mod_perl 2.0, its top-level Makefile.PL already
-# installs the uninstall code
-if (TOP_LEVEL) {
-    require "./install-pl";
-    add_Apache__test_target();
-}
-
 my @clean_files =
     qw(.mypacklist
        t/TEST
@@ -143,37 +134,6 @@
     close $fh;
 }

-sub sanity_check {
-    # don't allow running an explicit 'perl Makefile.PL', when
-    # Apache-Test is checked out into the modperl-2.0 tree, since
-    # it then decides that it's a part of the modperl-2.0 build and
-    # will try to use modperl httpd/apxs arguments which could be
-    # unset or wrong
-    if (TOP_LEVEL && -e "../lib/mod_perl2.pm") {
-        error "Do not run 'perl Makefile.PL' when Apache-Test is a " .
-            "subdirectory of modperl-2.0. Copy it elsewhere and run " .
-            "from there.";
-        Apache::TestRun::exit_perl(0);
-    }
-}
-
-if (TOP_LEVEL && $ExtUtils::MakeMaker::VERSION < 6.06) {
-    # now that we're using subversion, make sure that
-    # .svn directories are skipped during the build process
-    # for old versions of MakeMaker
-    *MY::libscan = sub {
-        my $self = shift;
-
-        my $path = shift;
-
-        return '' if $path =~ /\B\.svn\b/;
-
-        return $path;
-    };
-    # avoid warning: used only once: possible typo at ...
-    *MY::libscan = *MY::libscan;
-}
-
 sub MY::postamble {
     my $self = shift;

@@ -188,52 +148,11 @@
     return $string;
 }

-sub MY::constants {
-    my $self = shift;
-
-    my $string = $self->MM::constants;
-
-    # mp2 installs A-T into INSTALLSITEARCH, so in order to avoid
-    # problems when users forget 'make install UNINST=1', trick MM into
-    # installing pure perl modules to the sitearch location, when A-T is
-    # not installed as a part of mp2 build
-    if (TOP_LEVEL) {
-        $string .= <<'EOI';
-
-# install into the same location as mod_perl 2.0
-INSTALLSITELIB = $(INSTALLSITEARCH)
-DESTINSTALLSITELIB = $(DESTINSTALLSITEARCH)
-EOI
-    }
-
-    $string;
-}
-
 sub add_dep {
     my($string, $targ, $add) = @_;
     $$string =~ s/($targ\s+::)/$1 $add/;
 }

-sub add_Apache__test_target {
-    use subs qw(MY::install MY::top_targets);
-    *MY::install = sub {
-        my $self = shift;
-
-        my $string = $self->MM::install(@_);
-        add_dep(\$string, pure_install => 'nuke_Apache__test');
-        $string;
-    };
-
-    *MY::top_targets = sub {
-        my $self = shift;
-        my $string = $self->MM::top_targets;
-
-        $string .= Apache::Test::install::nuke_Apache__test_target();
-
-        $string;
-    };
-}
-
 sub MY::test {
     my $self = shift;

Index: lib/Apache/TestConfigPerl.pm
===================================================================
--- lib/Apache/TestConfigPerl.pm	(revision 1022724)
+++ lib/Apache/TestConfigPerl.pm	(working copy)
@@ -45,16 +45,21 @@
     # $server->{rev} could be set to 2 as a fallback, even when
     # the wanted version is 1. So check that we use mod_perl 2
     elsif ($server->{rev} >= 2 && IS_MOD_PERL_2) {
+
         if (my $build_config = $self->modperl_build_config()) {
             if ($build_config->{MODPERL_LIB_SHARED}) {
                 $libname = $build_config->{MODPERL_LIB_SHARED};
                 $vars->{libmodperl} ||= $self->find_apache_module($libname);
+            } else {
+                $vars->{libmodperl} ||=
$self->find_apache_module('mod_perl.so');
             }
             # XXX: we have a problem with several perl trees pointing
             # to the same httpd tree. So it's possible that we
             # configure the test suite to run with mod_perl.so built
             # against perl which it wasn't built with. Should we use
             # something like ldd to check the match?
+            #
+            # For now, we'll default to the first mod_perl.so found.
         }
         else {
             # XXX: can we test whether mod_perl was linked statically
Index: lib/Apache/TestConfig.pm
===================================================================
--- lib/Apache/TestConfig.pm	(revision 1022724)
+++ lib/Apache/TestConfig.pm	(working copy)
@@ -1011,11 +1011,13 @@
         }
     }

-    for (qw(. ..)) {
-        my $dir = canonpath catdir $FindBin::Bin, $_ , "Apache-Test", "lib";
-        if (-d $dir) {
-            push @dirs, $dir;
-            last;
+    foreach my $lib (qw( lib blib) ) {
+        for (qw(. ..)) {
+            my $dir = canonpath catdir $FindBin::Bin, $_ , "Apache-Test", $lib;
+            if (-d $dir) {
+                push @dirs, $dir;
+                last;
+            }
         }
     }

Index: Changes
===================================================================
--- Changes	(revision 1022724)
+++ Changes	(working copy)
@@ -8,6 +8,14 @@

 =item 1.34-dev

+When an explicit shared mod_perl lib is not defined, default to the first
+shared module found by find_apache_module().
+[Fred Moyer]
+
+Fix logic error in TOP_LEVEL constant calculation.  Remove Apache::test
+compatibility from mod_perl 1.27.
+[Fred Moyer]
+
 Remove the custom config feature, and instead use inline directives,
 ENV vars, and look for apxs et al in PATH.
 [Fred Moyer]


APACHE-RELOAD

Index: Makefile.PL
===================================================================
--- Makefile.PL	(revision 997487)
+++ Makefile.PL	(working copy)
@@ -5,7 +5,7 @@
 my %prereqs = ();
 my %mp2 = ( mod_perl2 => 1.99022 );
 my %mp1 = ( mod_perl  => 0 );
-my $at_min_ver = 1.30;
+my $at_min_ver = 1.34;

 my $mp_gen;
 if ($ENV{MOD_PERL_2_BUILD}) {
@@ -45,6 +45,7 @@
                               );
 }

+# MOD_PERL_2_BUILD is set from building from mod_perl Makefile.PL
 if ($ENV{MOD_PERL_2_BUILD}) {
     pop @ARGV;
 }
@@ -53,10 +54,9 @@
     return unless eval {
         require Apache::Test;
         if ($Apache::Test::VERSION < $at_min_ver) {
-            warn "Apache::Test version is " . $Apache::Test::VERSION .
+            die "Apache::Test version is " . $Apache::Test::VERSION .
                 ", minimum version required is $at_min_ver" .
                 ", tests will be skipped\n";
-            die;
         }
         require Apache::TestMM;
         require Apache::TestRunPerl;
@@ -67,13 +67,6 @@

     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::TestRunPerl->generate_script();

     return 1;
Index: Changes
===================================================================
--- Changes	(revision 997487)
+++ Changes	(working copy)
@@ -11,6 +11,9 @@

 =item 0.11 August 21, 2010

+Add Apache-Test 1.34 dependency.
+[Phred]
+
 Ignore require-hooks which exist in %INC
 [Ryan Gies <ryan@livesite.net>]


APACHE-SIZELIMIT

Index: Makefile.PL
===================================================================
--- Makefile.PL	(revision 997487)
+++ Makefile.PL	(working copy)
@@ -5,6 +5,7 @@
 my %prereqs = ();
 my %mp2 = ( mod_perl2 => 1.99022 );
 my %mp1 = ( mod_perl  => 0 );
+my $at_min_ver = 1.34;

 my $mp_gen;
 if ($ENV{MOD_PERL_2_BUILD}) {
@@ -72,6 +73,11 @@
 sub check_for_apache_test {
     return unless eval {
         require Apache::Test;
+         if ($Apache::Test::VERSION < $at_min_ver) {
+            die "Apache::Test version is " . $Apache::Test::VERSION .
+                ", minimum version required is $at_min_ver" .
+                ", tests will be skipped\n";
+        }
         require Apache::TestMM;
         require Apache::TestRunPerl;
         1;
@@ -81,13 +87,6 @@

     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::TestRunPerl->generate_script();

     return 1;

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


Mime
View raw message