Permalink
Browse files

Migrate the prompt bypassing code out of the 5.5+ Makefile generator

and into the base Makefile.PL.  This is the code that skips
interaction if STDIN isn't a terminal, or if --default is specified.
  • Loading branch information...
1 parent 4e5a3b7 commit cfa4b9a238e9f0de293e92b8eb0c49dd9f4c13fd @rcaputo committed Sep 5, 2004
Showing with 33 additions and 32 deletions.
  1. +30 −0 Makefile.PL
  2. +3 −32 mylib/Makefile-5005.pm
View
30 Makefile.PL
@@ -4,6 +4,36 @@ 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";
+}
+
+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",
+ );
+}
+
+
my $prompt = qq|
POE's test suite requires a functional network.
However, we can skip those tests requiring network
View
35 mylib/Makefile-5005.pm
@@ -4,57 +4,28 @@
use strict;
use lib qw(./mylib);
+
use ExtUtils::MakeMaker;
use File::Find;
use File::Spec;
-# Switch to default behavior if STDIN isn't a tty.
-unless (-t STDIN) {
- warn(
- "\n",
- "======================================================================\n",
- "\n",
- "Standard input is not a terminal/console. Reverting to --default\n",
- "behavior to avoid the prompts.\n",
- "\n",
- "======================================================================\n",
- "\n",
- );
- push @ARGV, "--default";
-}
-
eval "require ExtUtils::AutoInstall";
if ($@) {
warn(
"\n",
- "==================================================================\n",
+ "====================================================================\n",
"\n",
"POE's installer magic requires ExtUtils::AutoInstall. POE comes\n",
"with an older version, but it will not be installed. You should\n",
"install the most recent ExtUtils::AutoInstall at your convenience.\n",
"\n",
- "==================================================================\n",
+ "====================================================================\n",
"\n",
);
eval "require './mylib/ExtUtils/AutoInstall.pm'";
die if $@;
}
-unless (grep /^--default$/, @ARGV) {
- print(
- "\n",
- "=================================================================\n",
- "\n",
- "If the prompts are annoying, they can be bypassed by running\n",
- "\t$^X $0 --default\n",
- "\n",
- "Only necessary modules are installed by default.\n",
- "\n",
- "=================================================================\n",
- "\n",
- );
-}
-
ExtUtils::AutoInstall->import(
-version => '0.50',
-core => [

0 comments on commit cfa4b9a

Please sign in to comment.