Permalink
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...
1 parent 36930da commit e88fe82c4a8cbdd0d2a6f2b103c55d4f93db2308 @rcaputo committed Apr 12, 2005
Showing with 57 additions and 48 deletions.
  1. +57 −48 Makefile.PL
View
@@ -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?

0 comments on commit e88fe82

Please sign in to comment.