Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 133 lines (110 sloc) 3.019 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
#!/usr/bin/perl

use strict;
use ExtUtils::MakeMaker;
use Config;

# Switch to default behavior if STDIN isn't a tty.

unless (-t STDIN) {
  warn(
    "\n",
    "====================================================================\n",
    "\n",
    "Assuming --default because standard input is not a terminal.\n",
    "\n",
    "====================================================================\n",
    "\n",
  );
  push @ARGV, "--default";
}

# Remind the user she can use --default.

unless (grep /^--default$/, @ARGV) {
  warn(
    "\n",
    "====================================================================\n",
    "\n",
    "Prompts may be bypassed by running:\n",
    " $^X $0 --default\n",
     "\n",
    "Only necessary modules will be installed by default.\n",
    "\n",
    "====================================================================\n",
    "\n",
  );
}

# Should we skip the network tests?

my $prompt = qq|
POE's test suite requires a functional network.
However, we can skip those tests requiring network
access if you would like.

Would you like to skip the network tests?

|;

$prompt .= "(Any text other than Y or y will be taken as a no)";

my $ret = "n";
if (grep /^--default$/, @ARGV) {
  print $prompt, " [n] n\n\n";
}
else {
  $ret = prompt($prompt, "n");
}

my $marker = 'run_network_tests';

if($ret =~ /^Y$/i) {
    unlink $marker if $marker;
} else {
    open(TOUCH,"+>$marker") and close TOUCH;
}

print "\n";

# Comment out "use bytes" if it's not supported.

use File::Find;
my $code;
if ($] < 5.006) {
  print "Perl $] does not support bytes.pm. Commenting it out...\n";
  $code = 's/^(\s*)(use bytes;).*/$1#$2 # perl version $] at install/';
}
else {
  print "Perl $] supports bytes.pm. Ensuring it's in...\n";
  $code = 's/^(\s*)#\s*(use bytes;).*/$1$2/';
}

find(
  sub {
    next unless -f and /\.pm$/;
    system $^X, "-p", "-i.bak", "-e", $code, $_;
  },
  "lib"
);

# Which kind of makefile should we build?

if ($] < 5.005004) {
  warn(
    "\n",
    "===============================================================\n",
    "\n",
    "Please upgrade Perl to avoid lapses in support. Perl 5.005_04\n",
    "or newer is preferred. Support for older versions will be\n",
    "phased out in the future.\n",
    "\n",
    "Thank you.\n",
    "\n",
    "===============================================================\n",
    "\n",
  );

  require "./mylib/Makefile-5004.pm";
}
else {
  require "./mylib/Makefile-5005.pm";
}

# And finally, ask the user to run a test report.
#
# use Config;
# my $make = $Config::Config{make};
#
# print(
# "\n",
# "=======================================================================\n",
# "\n",
# "Please consider running '$make uploadreport' to create and upload a\n",
# "test report. You can see samples of other test reports by visitng\n",
# "http://eekeek.org/poe-tests/\n",
# "\n",
# "Thank you.\n",
# "\n",
# "=======================================================================\n",
# );

0;
Something went wrong with that request. Please try again.