On Wed Nov 21 11:42:19 2012, DOHERTY wrote:
Show quoted text> On Wed Nov 21 10:58:45 2012, DOHERTY wrote:
>
> Yeah, that totally doesn't work for cpanm... Config.PL might need to be
> merged into Makefile.PL.
You could try something more like this, maybe...
From 356aa4aab61a4c387ae752e5c77d2de7cf6e6f4f Mon Sep 17 00:00:00 2001
From: Mike Doherty <doherty@pythian.com>
Date: Wed, 21 Nov 2012 14:32:15 -0500
Subject: [PATCH] Don't prompt from Config.PL unless running interactively
---
Config.PL | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/Config.PL b/Config.PL
index a89d837..387bdf3 100644
--- a/Config.PL
+++ b/Config.PL
@@ -1,8 +1,18 @@
# Never modify Config.PPM, always Config.PL
# (Whenever you generate a distribution Config.PPM is overwriten by Config.PL)
-# just to tell make we are done with configuring
-open CFG, '>Config';print CFG "\n";close CFG;
+BEGIN {
+ # just to tell make we are done with configuring
+ open CFG, '>Config';
+ print CFG "\n";
+ close CFG;
+
+ my $isa_tty = -t STDIN && -t STDOUT;
+ if ($ENV{PERL_MM_USE_DEFAULT} || !$isa_tty) {
+ print "We appear to be running non-interactively -- no defaults will be set\n";
+ exit;
+ }
+}
use Cwd;
use FileHandle;
--
1.8.0