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/lib/Apache TestMM.pm
Date Wed, 26 Mar 2003 06:40:57 GMT
stas        2003/03/25 22:40:56

  Modified:    perl-framework/Apache-Test/lib/Apache TestMM.pm
  Log:
  refactor generate_script
  
  Revision  Changes    Path
  1.21      +11 -13    httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm
  
  Index: TestMM.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TestMM.pm	26 Mar 2003 00:51:01 -0000	1.20
  +++ TestMM.pm	26 Mar 2003 06:40:56 -0000	1.21
  @@ -68,25 +68,23 @@
       my $file = shift;
   
       unlink $file if -e $file;
  -    my $in = Symbol::gensym();
  -    my $out = Symbol::gensym();
  -    open $in, "$file.PL" or die "Couldn't open $file.PL: $!";
  -    open $out, ">$file" or die "Couldn't open $file: $!";
   
  -    info "generating script $file";
  -
  -    print $out "#!$Config{perlpath}\n",
  -               "# WARNING: this file is generated, edit $file.PL instead\n";
  +    my $content = '';
   
       if (@Apache::TestMM::Argv) {
  -        print $out "\%Apache::TestConfig::Argv = qw(@Apache::TestMM::Argv);\n";
  +        $content = "\%Apache::TestConfig::Argv = qw(@Apache::TestMM::Argv);\n";
       }
   
  -    print $out join '', <$in>;
  -
  -    close $out or die "close $file: $!";
  +    my $in = Symbol::gensym();
  +    open $in, "$file.PL" or die "Couldn't open $file.PL: $!";
  +    {
  +        local $/;
  +        $content .= <$in>;
  +    }
       close $in;
  -    chmod 0555, $file;
  +
  +    info "generating script $file";
  +    Apache::Test::config()->write_perlscript($file, $content);
   }
   
   sub filter_args {
  
  
  

Mime
View raw message