randyk      2003/05/09 18:11:18

  Modified:    win32    Configure.pl
  Log:
  conform to standard Perl coding style.
  
  Revision  Changes    Path
  1.2       +43 -43    httpd-apreq-2/win32/Configure.pl
  
  Index: Configure.pl
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/win32/Configure.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Configure.pl      5 May 2003 05:33:40 -0000       1.1
  +++ Configure.pl      10 May 2003 01:11:18 -0000      1.2
  @@ -1,10 +1,12 @@
  +#!C:/Perl/bin/perl
   use strict;
   use warnings;
   use Getopt::Long;
   my ($apache, $debug, $help);
   my $result = GetOptions( 'with-apache=s' => \$apache,
                         'debug' => \$debug,
  -                      'help' => \$help);
  +                      'help' => \$help,
  +                       );
   usage() if $help;
   
   $apache ||= search();
  @@ -12,18 +14,16 @@
   $apache =~ s!/!\\!g;
   
   my $cfg = $debug ? 'Debug' : 'Release';
  -
  -open(MAKE, '>Makefile') or die qq{Cannot open Makefile: $!};
  -
  -print MAKE <<"END";
  +open my $make, '>Makefile' or die qq{Cannot open Makefile: $!};
  +print $make <<"END";
   # Microsoft Developer Studio Generated NMAKE File.
   
   CFG=$cfg
   APACHE=$apache
   END
   
  -print MAKE $_ while (<DATA>);
  -close MAKE;
  +print $make $_ while (<DATA>);
  +close $make;
   
   print << 'END';
   
  @@ -39,7 +39,7 @@
   
   
   sub usage {
  -  print <<'END';
  +    print <<'END';
   
    Usage: perl Configure.pl [--with-apache=C:\Path\to\Apache] [--debug]
           perl Configure.pl --help
  @@ -54,54 +54,54 @@
   Apache2 directory, and if found, a non-debug version will be built.
   
   END
  -  exit;
  +    exit;
   }
   
   sub search {
  -  my $apache;
  - SEARCH: {
  -    for my $drive ('C' .. 'Z') {
  -      for my $p ('Apache2', 'Program Files/Apache2', 
  -              'Program Files/Apache Group/Apache2') {
  -     if (-d "$drive:/$p/bin") {
  -       $apache = "$drive:/$p";
  -       last SEARCH;
  -     }
  -      }
  +    my $apache;
  +  SEARCH: {
  +        for my $drive ('C' .. 'Z') {
  +            for my $p ('Apache2', 'Program Files/Apache2', 
  +                       'Program Files/Apache Group/Apache2') {
  +                if (-d "$drive:/$p/bin") {
  +                    $apache = "$drive:/$p";
  +                    last SEARCH;
  +                }
  +            }
  +        }
  +    }
  +    require ExtUtils::MakeMaker;
  +    ExtUtils::MakeMaker->import('prompt');
  +    unless (-d $apache) {
  +        $apache = prompt("Where is your Apache2 installed?", $apache);
       }
  -  }
  -  require ExtUtils::MakeMaker;
  -  ExtUtils::MakeMaker->import('prompt');
  -  unless (-d $apache) {
  -    $apache = prompt("Where is your Apache2 installed?", $apache);
  -  }
  -  die "Can't find a suitable Apache2 directory!" unless -d $apache;
  -
  -  my $ans = prompt(qq{Use "$apache" for your Apache2 directory?}, 'yes');
  -  unless ($ans =~ /^y/i) {
  -    die <<'END';
  +    die "Can't find a suitable Apache2 directory!" unless -d $apache;
  +
  +    my $ans = prompt(qq{Use "$apache" for your Apache2 directory?}, 'yes');
  +    unless ($ans =~ /^y/i) {
  +        die <<'END';
   
   Please run this configuration script again, and give
   the --with-apache=C:\Path\to\Apache2 option to specify
   the desired top-level Apache2 directory.
   
   END
  -  }
  -  
  -  require Win32;
  -  return Win32::GetShortPathName($apache);
  +    }
  +
  +    require Win32;
  +    return Win32::GetShortPathName($apache);
   }
   
   sub check {
  -  my $apache = shift;
  -  die qq{No libhttpd library found under $apache/lib}
  -    unless -e qq{$apache/lib/libhttpd.lib};
  -  die qq{No httpd header found under $apache/include}
  -    unless -e qq{$apache/include/httpd.h};
  -  my $vers = qx{"$apache/bin/Apache.exe" -v};
  -  die qq{"$apache" does not appear to be version 2.0}
  -    unless $vers =~ m!Apache/2.0!;
  -  return 1;
  +    my $apache = shift;
  +    die qq{No libhttpd library found under $apache/lib}
  +        unless -e qq{$apache/lib/libhttpd.lib};
  +    die qq{No httpd header found under $apache/include}
  +        unless -e qq{$apache/include/httpd.h};
  +    my $vers = qx{"$apache/bin/Apache.exe" -v};
  +    die qq{"$apache" does not appear to be version 2.0}
  +        unless $vers =~ m!Apache/2.0!;
  +    return 1;
   }
   
   __DATA__
  
  
  

Reply via email to