Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Part of ExtUtils::AutoInstall's automated install procedure involves

calling Makefile.PL multiple times with different parameters.  This
was causing the multiple "wanna run network tests?" questions.  Now we
skip the network tests prompt if Makefile.PL is being run again by
ExtUtils::AutoInstall.
  • Loading branch information...
commit e88fe82c4a8cbdd0d2a6f2b103c55d4f93db2308 1 parent 36930da
@rcaputo authored
Showing with 57 additions and 48 deletions.
  1. +57 −48 Makefile.PL
View
105 Makefile.PL
@@ -4,41 +4,47 @@ 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|
+# Skip reminders and prompting if we're being run in --checkdeps or
+# --installdeps batch modes. These are part of # ExtUtils::AutoInstall's
+# automatic install process.
+
+unless (grep /^--(check|install)deps/, @ARGV) {
+
+ # 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.
@@ -47,22 +53,25 @@ Would you like to skip the network tests?
|;
-$prompt .= "(Any text other than Y or y will be taken as a no)";
+ $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 $ret = "n";
+ if (grep /^--default$/, @ARGV) {
+ print $prompt, " [n] n\n\n";
+ }
+ else {
+ $ret = prompt($prompt, "n");
+ }
+
+ my $marker = 'run_network_tests';
-my $marker = 'run_network_tests';
+ if($ret =~ /^Y$/i) {
+ unlink $marker if $marker;
+ } else {
+ open(TOUCH,"+>$marker") and close TOUCH;
+ }
-if($ret =~ /^Y$/i) {
- unlink $marker if $marker;
-} else {
- open(TOUCH,"+>$marker") and close TOUCH;
+ print "\n";
}
# Which kind of makefile should we build?
Please sign in to comment.
Something went wrong with that request. Please try again.