sbekman     01/04/20 11:08:09

  Modified:    util     config.pl
  Added:       lib/ModPerl Config.pm
               util     bugreport.pl
  Log:
  * moving the code from util/config.pl into a new lib/ModPerl/Config.pm
  * now util/config.pl uses lib/ModPerl/Config.pm
  * a new bugreport util uses lib/ModPerl/Config.pm
  
  Revision  Changes    Path
  1.1                  modperl-2.0/lib/ModPerl/Config.pm
  
  Index: Config.pm
  ===================================================================
  package ModPerl::Config;
  
  use lib qw(Apache-Test/lib);
  
  use Apache::Build ();
  use Apache::TestConfig ();
  
  sub config_as_str{
      my $build_config = Apache::Build->build_config;
  
      my $cfg = '';
  
      $cfg .= "*** using $INC{'Apache/BuildConfig.pm'}\n";
  
      $cfg .= "*** Makefile.PL options:\n";
      $cfg .= join '',
          map {sprintf "    %-20s => %s\n", $_, $build_config->{$_}}
              grep /^MP_/, sort keys %$build_config;
  
      my $test_config = Apache::TestConfig->new;
      my $httpd = $test_config->{vars}->{httpd};
      $command = "$httpd -v";
      $cfg .= "\n\n*** $command\n";
      $cfg .= qx{$command};
  
      my $perl = $build_config->{MODPERL_PERLPATH};
      $command = "$perl -V";
      $cfg .= "\n\n*** $command\n";
      $cfg .= qx{$command};
  
      return $cfg;
  
  }
  
  1;
  __END__
  
  =pod
  
  =head1 NAME - ModPerl::Config
  
  =head1 DESCRIPTION
  
  Functions to retrieve mod_perl specific env information.
  
  =cut
  
  
  
  
  1.2       +6 -24     modperl-2.0/util/config.pl
  
  Index: config.pl
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/util/config.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- config.pl 2001/04/20 17:07:47     1.1
  +++ config.pl 2001/04/20 18:08:06     1.2
  @@ -1,27 +1,9 @@
  -use lib qw(lib);
  -use lib qw(Apache-Test/lib);
  +#!/usr/bin/perl -w
   
  -use Apache::Build ();
  -use Apache::TestConfig ();
  +use strict;
  +use FindBin qw($Bin);
  +use lib "$Bin/../lib";
   
  -my $build_config = Apache::Build->build_config;
  +use ModPerl::Config ();
   
  -print "using $INC{'Apache/BuildConfig.pm'}\n";
  -
  -print "Makefile.PL options:\n";
  -for (sort keys %$build_config) {
  -    next unless /^MP_/;
  -    printf "    %-20s => %s\n", $_, $build_config->{$_};
  -}
  -
  -my $test_config = Apache::TestConfig->new;
  -my $httpd = $test_config->{vars}->{httpd};
  -
  -print "\n$httpd -V:\n";
  -system "$httpd -V";
  -
  -my $perl = $build_config->{MODPERL_PERLPATH};
  -
  -print "\n$perl -V:\n";
  -system "$perl -V";
  -
  +print ModPerl::Config::config_as_str();
  
  
  
  1.1                  modperl-2.0/util/bugreport.pl
  
  Index: bugreport.pl
  ===================================================================
  #!/usr/bin/perl -w
  
  use strict;
  use FindBin qw($Bin);
  use lib "$Bin/../lib";
  
  use ModPerl::Config ();
  
  my $env = ModPerl::Config::config_as_str();
  {
      local $/ = undef;
      my $template = <DATA>;
      $template =~ s/\[CONFIG\]/$env/;
      print $template;
  }
  
  __DATA__
  
  -------------8<----------Start Bug Report ------------8<----------
  1. Problem Description:
  
    [DESCRIBE THE PROBLEM HERE]
  
  2. Used Components and their Configuration:
  
  [CONFIG]
  
  3. This is the core dump trace: (if you get a core dump):
  
    [CORE TRACE COMES HERE]
  
  -------------8<----------End Bug Report --------------8<----------
  
  Note: Complete the rest of the details and post this bug report to
  [EMAIL PROTECTED] as is. To subscribe to the list send an empty
  email to [EMAIL PROTECTED]
  
  
  

Reply via email to