httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test Makefile.PL Changes
Date Wed, 18 Jun 2003 02:57:10 GMT
stas        2003/06/17 19:57:10

  Modified:    perl-framework/Apache-Test Makefile.PL Changes
  Log:
  Instrumented Makefile.PL to unconditionally remove any old
  pre-installed occurrences of Apache/test.pm, which has been renamed to
  Apache/testold.pm in mod_perl 1.28 to avoid collisions with
  Apache/Test.pm on case-insensitive systems.
  
  Revision  Changes    Path
  1.9       +77 -0     httpd-test/perl-framework/Apache-Test/Makefile.PL
  
  Index: Makefile.PL
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Makefile.PL,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Makefile.PL	29 Apr 2003 06:37:47 -0000	1.8
  +++ Makefile.PL	18 Jun 2003 02:57:10 -0000	1.9
  @@ -7,10 +7,14 @@
   
   my $VERSION;
   
  +use File::Spec::Functions qw(catfile catdir);
  +
   use Apache::Test5005compat;
   
   use Apache::TestMM qw(test); #enable 'make test'
   
  +my $cleanup_packlist = ".mypacklist";
  +
   Apache::TestMM::filter_args();
   
   my @scripts = qw(t/TEST);
  @@ -21,6 +25,8 @@
   
   set_version();
   
  +nuke_Apache__test();
  +
   WriteMakefile(
       NAME      => 'Apache::Test',
       VERSION   => $VERSION,
  @@ -59,3 +65,74 @@
       return $string;
   }
   
  +
  +# 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 {
  +
  +    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;
  +}
  +
  +sub MY::install {
  +    my $self = shift;
  +
  +    my $string = $self->MM::install(@_);
  +    add_dep(\$string, pure_install => 'nuke_Apache__test');
  +
  +    $string;
  +}
  +
  +sub MY::top_targets {
  +    my $self = shift;
  +    my $string = $self->MY::top_targets;
  +
  +    $string .= <<EOF;
  +
  +nuke_Apache__test:
  +\t\$(PERLRUN) -MExtUtils::Install -e "uninstall(qq{$cleanup_packlist}, 1, 0)"
  +EOF
  +
  +    $string;
  +}
  +
  +sub add_dep {
  +    my($string, $targ, $add) = @_;
  +    $$string =~ s/($targ\s+::)/$1 $add/;
  +}
  
  
  
  1.27      +11 -6     httpd-test/perl-framework/Apache-Test/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Changes	6 Jun 2003 01:46:13 -0000	1.26
  +++ Changes	18 Jun 2003 02:57:10 -0000	1.27
  @@ -8,6 +8,11 @@
   
   =item 1.03-dev - 
   
  +Instrumented Makefile.PL to unconditionally remove any old
  +pre-installed occurrences of Apache/test.pm, which has been renamed to
  +Apache/testold.pm in mod_perl 1.28 to avoid collisions with
  +Apache/Test.pm on case-insensitive systems. [Stas]
  +
   Apache::TestClient now handles correctly responses with no body and
   its response header() method is no longer case-sensitive [Stas]
   
  @@ -31,12 +36,12 @@
   '_sub' suffix is appended (e.g., 'error_info') the trace will start
   with the name of the subroutine the function was called from. [Stas]
   
  -introduce a new env var APACHE_TEST_TRACE_LEVEL, to override the trace
  -level. Propogate the overriden values (either by env var
  -APACHE_TEST_TRACE_LEVEL or -trace option) to the server-side, so we
  -can use tracing in the handlers, and enable disable traces from the
  -commmand line. This way we don't have to comment out debug
  -tracing. [Stas]
  +add support for a new env var APACHE_TEST_TRACE_LEVEL, used to
  +override the tracing level. It propogates the overriden (either by env
  +var APACHE_TEST_TRACE_LEVEL or -trace option) value to the
  +server-side, so we can use Apache::TestTrace in mod_perl handlers, and
  +be able enable/disable tracing from the commmand line. This way we
  +don't have to comment out debug prints. [Stas]
   
   =item 1.02
   
  
  
  

Mime
View raw message