Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mail-Sender CPAN distribution.

Report information
The Basics
Id: 74698
Status: resolved
Priority: 0/
Queue: Mail-Sender

People
Owner: Nobody in particular
Requestors: SARFY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Mail::Sender not respecting silent installations
Hi, cpan has an option for silent module installation, activated using PERL_MM_USE_DEFAULT=1 environment variable. Mail::Sender is asking if user wants to configure module default settings, violating silent installation. Martin
Subject: 0001-RT-74698-Don-t-prompt-when-PERL_MM_USE_DEFAULT-1.patch
From b9766594608ef6ac81c93d16c3a05526703fa3a7 Mon Sep 17 00:00:00 2001 From: Mike Doherty <doherty@pythian.com> Date: Wed, 21 Nov 2012 10:56:02 -0500 Subject: [PATCH] [RT#74698] Don't prompt when PERL_MM_USE_DEFAULT=1 Don't set any defaults when PERL_MM_USE_DEFAULT=1, which specifies that the module should install non-interactively. Fixes RT #74698: Mail::Sender not respecting silent installations --- Config.PL | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Config.PL b/Config.PL index a89d837..7cb6b29 100644 --- a/Config.PL +++ b/Config.PL @@ -71,9 +71,14 @@ nmake.exe may be found at ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe\n } } -print "\nSpecify$new defaults for Mail::Sender? (y/N) "; -$res = <STDIN>; -exit unless $res =~ /^y$/i; +unless ( $ENV{PERL_MM_USE_DEFAULT} ) { + print "\nSpecify$new defaults for Mail::Sender? (y/N) "; + $res = <STDIN>; + exit unless $res =~ /^y$/i; +} +else { # Do not prompt - no defaults will be set + exit; +} if (! $configfile) { print "\n\t... will be saved to .../lib/Mail/Sender.config\n"; -- 1.8.0
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.
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...
Subject: 0001-Don-t-prompt-from-Config.PL-unless-running-interacti.patch
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
Fixed in 0.8.22