Thread: [Module::Build] PERL_MM_USE_DEFAULT
Status: Beta
Brought to you by:
kwilliams
From: Tyler M. <ty...@yi...> - 2006-01-16 02:20:17
|
Hi, I think it would be a great thing if Module::Build obeyed the PERL_MM_USE_DEFAULT environment variable supported by ExtUtils::MakeMaker. It would make it much easier for an admin to quickly install a bunch of packages in CPAN.pm without having to worry about checking back for prompts. Cheers, Tyler |
From: Tyler M. <ty...@yi...> - 2006-01-19 02:58:40
|
Ken, Would it be possible to change this: sub _is_interactive { return -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe? } To this: sub _is_interactive { return (!$ENV{PERL_MM_USE_DEFAULT}) && -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe? } ? Thanks, Tyler Tyler MacDonald <ty...@yi...> wrote: > Hi, > > I think it would be a great thing if Module::Build obeyed the > PERL_MM_USE_DEFAULT environment variable supported by ExtUtils::MakeMaker. > It would make it much easier for an admin to quickly install a bunch of > packages in CPAN.pm without having to worry about checking back for prompts. > > Cheers, > Tyler > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Module-build-general mailing list > Mod...@li... > https://lists.sourceforge.net/lists/listinfo/module-build-general > |
From: Yitzchak Scott-T. <sth...@ef...> - 2006-01-19 11:14:36
|
On Wed, Jan 18, 2006 at 06:55:59PM -0800, Tyler MacDonald wrote: > Ken, > > Would it be possible to change this: > > sub _is_interactive { > return -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe? > } > > To this: > > sub _is_interactive { > return (!$ENV{PERL_MM_USE_DEFAULT}) && -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)) ; # Pipe? > } I think _is_interactive should stay the same in how it is used in y_n, but prompt() should be made to work like EU::MM::prompt. This means skipping the read if PERL_MM_USE_DEFAULT is set, but actually trying to read even if not interactive, so an input file of responses can be given. This should do it: --- Module-Build-0.27_05/lib/Module/Build/Base.pm.orig 2006-01-17 00:39:03.266454000 -0800 +++ Module-Build-0.27_05/lib/Module/Build/Base.pm 2006-01-18 22:13:09.393200000 -0800 @@ -358,7 +358,8 @@ sub prompt { print "$mess $dispdef"; } my $ans; - if ($self->_is_interactive) { + if ( ! $ENV{PERL_MM_USE_DEFAULT} && + ( $self->_is_interactive || ! eof STDIN ) ) { $ans = <STDIN>; if ( defined $ans ) { chomp $ans; --- Module-Build-0.27_05/lib/Module/Build/Authoring.pod.orig 2006-01-12 15:56:39.000000000 -0800 +++ Module-Build-0.27_05/lib/Module/Build/Authoring.pod 2006-01-18 22:16:49.970374400 -0800 @@ -1229,10 +1229,12 @@ which is optional, specifies a default answer (for example, C<"wallet">). The user will be asked the question once. -If the current session doesn't seem to be interactive (i.e. if -C<STDIN> and C<STDOUT> look like they're attached to files or -something, not terminals), we'll just use the default without -letting the user provide an answer. +If C<prompt()> detects that it is not running interactively and there +is nothing on STDIN or if the PERL_MM_USE_DEFAULT environment variable +is set to true, the $default will be used without prompting. This +prevents automated processes from blocking on user input. + +If no $default is provided an empty string will be used instead. This method may be called as a class or object method. The doc paragraphs are taken verbatim from makemaker. Hope this sounds ok, Yitzchak (who's starting to wonder if Ken is on vacation) |
From: Tyler M. <ty...@yi...> - 2006-01-19 18:02:46
|
Yitzchak Scott-Thoennes <sth...@ef...> wrote: > I think _is_interactive should stay the same in how it is used in y_n, > but prompt() should be made to work like EU::MM::prompt. This means > skipping the read if PERL_MM_USE_DEFAULT is set, but actually trying > to read even if not interactive, so an input file of responses can be > given. This should do it: I agree this makes more sense, but there's one problem. With your change, it looks like if: - PERL_MM_USE_DEFAULT is set, - and y_n() is called without a default, - *and* the session is attached to at terminal then y_n will just loop forever. :-/ - Tyler > > --- Module-Build-0.27_05/lib/Module/Build/Base.pm.orig 2006-01-17 00:39:03.266454000 -0800 > +++ Module-Build-0.27_05/lib/Module/Build/Base.pm 2006-01-18 22:13:09.393200000 -0800 > @@ -358,7 +358,8 @@ sub prompt { > print "$mess $dispdef"; > } > my $ans; > - if ($self->_is_interactive) { > + if ( ! $ENV{PERL_MM_USE_DEFAULT} && > + ( $self->_is_interactive || ! eof STDIN ) ) { > $ans = <STDIN>; > if ( defined $ans ) { > chomp $ans; > --- Module-Build-0.27_05/lib/Module/Build/Authoring.pod.orig 2006-01-12 15:56:39.000000000 -0800 > +++ Module-Build-0.27_05/lib/Module/Build/Authoring.pod 2006-01-18 22:16:49.970374400 -0800 > @@ -1229,10 +1229,12 @@ > which is optional, specifies a default answer (for example, > C<"wallet">). The user will be asked the question once. > > -If the current session doesn't seem to be interactive (i.e. if > -C<STDIN> and C<STDOUT> look like they're attached to files or > -something, not terminals), we'll just use the default without > -letting the user provide an answer. > +If C<prompt()> detects that it is not running interactively and there > +is nothing on STDIN or if the PERL_MM_USE_DEFAULT environment variable > +is set to true, the $default will be used without prompting. This > +prevents automated processes from blocking on user input. > + > +If no $default is provided an empty string will be used instead. > > This method may be called as a class or object method. > > > The doc paragraphs are taken verbatim from makemaker. > > Hope this sounds ok, > Yitzchak (who's starting to wonder if Ken is on vacation) > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Module-build-general mailing list > Mod...@li... > https://lists.sourceforge.net/lists/listinfo/module-build-general > |
From: Yitzchak Scott-T. <sth...@ef...> - 2006-01-19 20:59:36
|
Oops, right. I would be inclined to make y_n require a default. Without it, the build is going fail for the first person who runs with </dev/null (in the existing code) or PERL_MM_USE_DEFAULT=1 (with my patch to prompt()). Might as well force the module author to not make this mistake. --- lib/Module/Build/Base.pm.orig 2006-01-18 22:13:09.393200000 -0800 +++ lib/Module/Build/Base.pm 2006-01-19 12:05:44.234734400 -0800 @@ -379,6 +379,7 @@ sub y_n { my $self = shift; die "y_n() called without a prompt message" unless @_; + die "y_n() called without y or n default" unless ($_[1]||"")=~/[yn]/i; my $interactive = $self->_is_interactive; my $answer; @@ -386,7 +387,6 @@ $answer = $self->prompt(@_); return 1 if $answer =~ /^y/i; return 0 if $answer =~ /^n/i; - die "No y/n answer given, no default supplied, and no user to ask again" unless $interactive; print "Please answer 'y' or 'n'.\n"; } } On Thu, Jan 19, 2006 at 09:58:52AM -0800, Tyler MacDonald wrote: > Yitzchak Scott-Thoennes <sth...@ef...> wrote: > > I think _is_interactive should stay the same in how it is used in y_n, > > but prompt() should be made to work like EU::MM::prompt. This means > > skipping the read if PERL_MM_USE_DEFAULT is set, but actually trying > > to read even if not interactive, so an input file of responses can be > > given. This should do it: > > I agree this makes more sense, but there's one problem. With your > change, it looks like if: > > - PERL_MM_USE_DEFAULT is set, > - and y_n() is called without a default, > - *and* the session is attached to at terminal > > then y_n will just loop forever. :-/ |
From: Tyler M. <ty...@yi...> - 2006-01-20 01:44:05
|
Yitzchak Scott-Thoennes <sth...@ef...> wrote: > Without it, the build is going fail for the first person who > runs with </dev/null (in the existing code) or PERL_MM_USE_DEFAULT=1 > (with my patch to prompt()). > > Might as well force the module author to not make this mistake. True... we're *almost* there; I'd change this: die "y_n() called without y or n default" unless ($_[1]||"")=~/[yn]/i; To: die "y_n() called without y or n default" unless ($_[1]||"")=~/^[yn]/i; - Tyler |
From: Yitzchak Scott-T. <sth...@ef...> - 2006-01-20 09:04:31
|
On Thu, Jan 19, 2006 at 05:41:21PM -0800, Tyler MacDonald wrote: > Yitzchak Scott-Thoennes <sth...@ef...> wrote: > > Without it, the build is going fail for the first person who > > runs with </dev/null (in the existing code) or PERL_MM_USE_DEFAULT=1 > > (with my patch to prompt()). > > > > Might as well force the module author to not make this mistake. > > True... we're *almost* there; I'd change this: > > die "y_n() called without y or n default" unless ($_[1]||"")=~/[yn]/i; > > To: > > die "y_n() called without y or n default" unless ($_[1]||"")=~/^[yn]/i; Sigh. The carat was there when I wrote that; my mailer must have eaten it along the way, and somehow got the one in the Base.pm I edited too :) --- Module-Build-0.27_05/lib/Module/Build/Base.pm.orig 2006-01-18 22:13:09.393200000 -0800 +++ Module-Build-0.27_05/lib/Module/Build/Base.pm 2006-01-19 23:27:54.418640000 -0800 @@ -379,6 +379,7 @@ sub y_n { my $self = shift; die "y_n() called without a prompt message" unless @_; + die "y_n() called without y or n default" unless ($_[1]||"")=~/^[yn]/i; my $interactive = $self->_is_interactive; my $answer; @@ -386,7 +387,6 @@ $answer = $self->prompt(@_); return 1 if $answer =~ /^y/i; return 0 if $answer =~ /^n/i; - die "No y/n answer given, no default supplied, and no user to ask again" unless $interactive; print "Please answer 'y' or 'n'.\n"; } } |
From: Ken W. <ke...@ma...> - 2006-01-22 02:30:19
|
Thanks, applied, along with the earlier patch in this thread. -Ken On Jan 20, 2006, at 3:04 AM, Yitzchak Scott-Thoennes wrote: > On Thu, Jan 19, 2006 at 05:41:21PM -0800, Tyler MacDonald wrote: >> Yitzchak Scott-Thoennes <sth...@ef...> wrote: >>> Without it, the build is going fail for the first person who >>> runs with </dev/null (in the existing code) or PERL_MM_USE_DEFAULT=1 >>> (with my patch to prompt()). >>> >>> Might as well force the module author to not make this mistake. >> >> True... we're *almost* there; I'd change this: >> >> die "y_n() called without y or n default" unless ($_[1]||"")=~/[yn]/i; >> >> To: >> >> die "y_n() called without y or n default" unless >> ($_[1]||"")=~/^[yn]/i; > > Sigh. The carat was there when I wrote that; my mailer must have eaten > it along the way, and somehow got the one in the Base.pm I edited too > :) > > --- Module-Build-0.27_05/lib/Module/Build/Base.pm.orig 2006-01-18 > 22:13:09.393200000 -0800 > +++ Module-Build-0.27_05/lib/Module/Build/Base.pm 2006-01-19 > 23:27:54.418640000 -0800 > @@ -379,6 +379,7 @@ > sub y_n { > my $self = shift; > die "y_n() called without a prompt message" unless @_; > + die "y_n() called without y or n default" unless > ($_[1]||"")=~/^[yn]/i; > > my $interactive = $self->_is_interactive; > my $answer; > @@ -386,7 +387,6 @@ > $answer = $self->prompt(@_); > return 1 if $answer =~ /^y/i; > return 0 if $answer =~ /^n/i; > - die "No y/n answer given, no default supplied, and no user to ask > again" unless $interactive; > print "Please answer 'y' or 'n'.\n"; > } > } > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Module-build-general mailing list > Mod...@li... > https://lists.sourceforge.net/lists/listinfo/module-build-general |
From: Yitzchak Scott-T. <sth...@ef...> - 2006-01-23 21:21:38
|
Changes should probably note this: --- Changes.orig 2006-01-23 10:57:34.759486000 -0800 +++ Changes 2006-01-23 13:18:45.189366400 -0800 @@ -8,7 +8,8 @@ - We should now work with recent (> 0.49) versions of YAML.pm when creating the META.yml file. [Yitzchak Scott-Thoennes] - - The prompt() and y_n() methods have been improved with respect to + - The y_n() method now requires the default parameter, and the + prompt() and y_n() methods have been improved with respect to how they behave/detect when there is no user to ask. We're now more consistent with MakeMaker, including respecting the PERL_MM_USE_DEFAULT environment variable. [Tyler MacDonald and On Sat, Jan 21, 2006 at 08:30:14PM -0600, Ken Williams wrote: > Thanks, applied, along with the earlier patch in this thread. > > -Ken > > On Jan 20, 2006, at 3:04 AM, Yitzchak Scott-Thoennes wrote: > > >On Thu, Jan 19, 2006 at 05:41:21PM -0800, Tyler MacDonald wrote: > >>Yitzchak Scott-Thoennes <sth...@ef...> wrote: > >>>Without it, the build is going fail for the first person who > >>>runs with </dev/null (in the existing code) or PERL_MM_USE_DEFAULT=1 > >>>(with my patch to prompt()). > >>> > >>>Might as well force the module author to not make this mistake. > >> > >>True... we're *almost* there; I'd change this: > >> > >>die "y_n() called without y or n default" unless ($_[1]||"")=~/[yn]/i; > >> > >>To: > >> > >>die "y_n() called without y or n default" unless > >>($_[1]||"")=~/^[yn]/i; > > > >Sigh. The carat was there when I wrote that; my mailer must have eaten > >it along the way, and somehow got the one in the Base.pm I edited too > >:) > > > >--- Module-Build-0.27_05/lib/Module/Build/Base.pm.orig 2006-01-18 > >22:13:09.393200000 -0800 > >+++ Module-Build-0.27_05/lib/Module/Build/Base.pm 2006-01-19 > >23:27:54.418640000 -0800 > >@@ -379,6 +379,7 @@ > > sub y_n { > > my $self = shift; > > die "y_n() called without a prompt message" unless @_; > >+ die "y_n() called without y or n default" unless > >($_[1]||"")=~/^[yn]/i; > > > > my $interactive = $self->_is_interactive; > > my $answer; > >@@ -386,7 +387,6 @@ > > $answer = $self->prompt(@_); > > return 1 if $answer =~ /^y/i; > > return 0 if $answer =~ /^n/i; > >- die "No y/n answer given, no default supplied, and no user to ask > >again" unless $interactive; > > print "Please answer 'y' or 'n'.\n"; > > } > > } > > > > > >------------------------------------------------------- > >This SF.net email is sponsored by: Splunk Inc. Do you grep through log > >files > >for problems? Stop! Download the new AJAX search engine that makes > >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > >http://sel.as-us.falkag.net/sel? > >cmd=lnk&kid=103432&bid=230486&dat=121642 > >_______________________________________________ > >Module-build-general mailing list > >Mod...@li... > >https://lists.sourceforge.net/lists/listinfo/module-build-general > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Module-build-general mailing list > Mod...@li... > https://lists.sourceforge.net/lists/listinfo/module-build-general |
From: Ken W. <ke...@ma...> - 2006-01-24 01:23:54
|
Indeed, thanks. -Ken On Jan 23, 2006, at 3:21 PM, Yitzchak Scott-Thoennes wrote: > Changes should probably note this: > > --- Changes.orig 2006-01-23 10:57:34.759486000 -0800 > +++ Changes 2006-01-23 13:18:45.189366400 -0800 > @@ -8,7 +8,8 @@ > - We should now work with recent (> 0.49) versions of YAML.pm when > creating the META.yml file. [Yitzchak Scott-Thoennes] > > - - The prompt() and y_n() methods have been improved with respect to > + - The y_n() method now requires the default parameter, and the > + prompt() and y_n() methods have been improved with respect to > how they behave/detect when there is no user to ask. We're now > more consistent with MakeMaker, including respecting the > PERL_MM_USE_DEFAULT environment variable. [Tyler MacDonald and |
From: Tyler M. <ty...@yi...> - 2006-01-24 01:43:38
|
Ken Williams <ke...@ma...> wrote: > Thanks, applied, along with the earlier patch in this thread. Awesome :) How close are we to having a 0.27_06? I'd like to update my distributions to depend on that version so I can add automated testing of my Build.PL. Cheers, Tyler |
From: Ken W. <ke...@ma...> - 2006-01-24 03:45:33
|
On Jan 23, 2006, at 7:41 PM, Tyler MacDonald wrote: > Ken Williams <ke...@ma...> wrote: >> Thanks, applied, along with the earlier patch in this thread. > > Awesome :) How close are we to having a 0.27_06? I can roll one out now. -Ken |
From: Randy W. S. <ml...@th...> - 2006-03-07 10:34:50
|
Sorry for responding late to this, but won't this break exististing distributions? Distros that currently use y_n() without defaults will start die-ing when users upgrade M::B. Randy. Ken Williams wrote: > Thanks, applied, along with the earlier patch in this thread. > > On Jan 20, 2006, at 3:04 AM, Yitzchak Scott-Thoennes wrote: >> >> --- Module-Build-0.27_05/lib/Module/Build/Base.pm.orig 2006-01-18 >> 22:13:09.393200000 -0800 >> +++ Module-Build-0.27_05/lib/Module/Build/Base.pm 2006-01-19 >> 23:27:54.418640000 -0800 >> @@ -379,6 +379,7 @@ >> sub y_n { >> my $self = shift; >> die "y_n() called without a prompt message" unless @_; >> + die "y_n() called without y or n default" unless >> ($_[1]||"")=~/^[yn]/i; >> >> my $interactive = $self->_is_interactive; >> my $answer; >> @@ -386,7 +387,6 @@ >> $answer = $self->prompt(@_); >> return 1 if $answer =~ /^y/i; >> return 0 if $answer =~ /^n/i; >> - die "No y/n answer given, no default supplied, and no user to >> ask again" unless $interactive; >> print "Please answer 'y' or 'n'.\n"; >> } >> } |
From: Yitzchak Scott-T. <sth...@ef...> - 2006-03-07 15:25:55
|
It doesn't break them in the sense that they were already broken for some users. But maybe it would be better to pick an arbitrary default? On Tue, Mar 07, 2006 at 05:33:49AM -0500, Randy W. Sims wrote: > > Sorry for responding late to this, but won't this break exististing > distributions? Distros that currently use y_n() without defaults will > start die-ing when users upgrade M::B. > > Randy. > > > Ken Williams wrote: > >Thanks, applied, along with the earlier patch in this thread. > > > >On Jan 20, 2006, at 3:04 AM, Yitzchak Scott-Thoennes wrote: > >> > >>--- Module-Build-0.27_05/lib/Module/Build/Base.pm.orig 2006-01-18 > >>22:13:09.393200000 -0800 > >>+++ Module-Build-0.27_05/lib/Module/Build/Base.pm 2006-01-19 > >>23:27:54.418640000 -0800 > >>@@ -379,6 +379,7 @@ > >> sub y_n { > >> my $self = shift; > >> die "y_n() called without a prompt message" unless @_; > >>+ die "y_n() called without y or n default" unless > >>($_[1]||"")=~/^[yn]/i; > >> > >> my $interactive = $self->_is_interactive; > >> my $answer; > >>@@ -386,7 +387,6 @@ > >> $answer = $self->prompt(@_); > >> return 1 if $answer =~ /^y/i; > >> return 0 if $answer =~ /^n/i; > >>- die "No y/n answer given, no default supplied, and no user to > >>ask again" unless $interactive; > >> print "Please answer 'y' or 'n'.\n"; > >> } > >> } |
From: Randy W. S. <ml...@th...> - 2006-04-06 11:07:49
|
Yitzchak Scott-Thoennes wrote: > On Tue, Mar 07, 2006 at 05:33:49AM -0500, Randy W. Sims wrote: > >>Sorry for responding late to this, but won't this break exististing >>distributions? Distros that currently use y_n() without defaults will >>start die-ing when users upgrade M::B. > It doesn't break them in the sense that they were already broken for some users. But maybe it would be better to pick an arbitrary default? I don't think there is a reasonable default. I think the only way around the issue is to create new methods and deprecate the older ones or not require defaults. It's not reasonable to have Build scripts failing just because a user upgrades to a new version of Module::Build. This needs to be resolved before 0.28. Any other ideas for solutions? Regards, Randy. |
From: Yitzchak Scott-T. <sth...@ef...> - 2006-04-06 15:09:49
|
On Thu, Apr 06, 2006 at 07:05:19AM -0400, Randy W. Sims wrote: > Yitzchak Scott-Thoennes wrote: > >On Tue, Mar 07, 2006 at 05:33:49AM -0500, Randy W. Sims wrote: > > > >>Sorry for responding late to this, but won't this break exististing > >>distributions? Distros that currently use y_n() without defaults will > >>start die-ing when users upgrade M::B. > > >It doesn't break them in the sense that they were already broken for some > >users. But maybe it would be better to pick an arbitrary default? > > I don't think there is a reasonable default. That's why I suggested an arbitrary one :) > I think the only way around > the issue is to create new methods and deprecate the older ones or not > require defaults. If you have a deprecated y_n method and replacements with longer names, people will continue to use y_n :( > It's not reasonable to have Build scripts failing just > because a user upgrades to a new version of Module::Build. > > This needs to be resolved before 0.28. Any other ideas for solutions? I'll try to come up with one or more suggestions. |
From: Randy W. S. <ml...@th...> - 2006-04-06 17:47:49
|
Yitzchak Scott-Thoennes wrote: > On Thu, Apr 06, 2006 at 07:05:19AM -0400, Randy W. Sims wrote: > >>Yitzchak Scott-Thoennes wrote: >> >>>On Tue, Mar 07, 2006 at 05:33:49AM -0500, Randy W. Sims wrote: >>> >>> >>>>Sorry for responding late to this, but won't this break exististing >>>>distributions? Distros that currently use y_n() without defaults will >>>>start die-ing when users upgrade M::B. >> >>>It doesn't break them in the sense that they were already broken for some >>>users. But maybe it would be better to pick an arbitrary default? >> >>I don't think there is a reasonable default. > > > That's why I suggested an arbitrary one :) > > >>I think the only way around >>the issue is to create new methods and deprecate the older ones or not >>require defaults. > > > If you have a deprecated y_n method and replacements with longer names, > people will continue to use y_n :( > > >>It's not reasonable to have Build scripts failing just >>because a user upgrades to a new version of Module::Build. >> >>This needs to be resolved before 0.28. Any other ideas for solutions? > > > I'll try to come up with one or more suggestions. $builder->ask( prompt => "Do you want to continue?", options => ['&yes' '&no' 'may&be'], default => 'b', ); > Do you want to continue? (Yes/No/mayBe) [b] $builder->ask( prompt => "Enter your user name:", options => [], default => 'guest' ); > Enter your username: [guest] $builder->ask( prompt => "Enter your user name:", options => [], default => 'guest', hide_default => 1, ); > Enter your username: or Something like that ? Randy. |
From: demerphq <dem...@gm...> - 2006-04-06 18:17:32
|
On 4/6/06, Randy W. Sims <ml...@th...> wrote: > Yitzchak Scott-Thoennes wrote: > > On Tue, Mar 07, 2006 at 05:33:49AM -0500, Randy W. Sims wrote: > > > >>Sorry for responding late to this, but won't this break exististing > >>distributions? Distros that currently use y_n() without defaults will > >>start die-ing when users upgrade M::B. > > > It doesn't break them in the sense that they were already broken for so= me users. But maybe it would be better to pick an arbitrary default? > > I don't think there is a reasonable default. I think the only way around > the issue is to create new methods and deprecate the older ones or not > require defaults. It's not reasonable to have Build scripts failing just > because a user upgrades to a new version of Module::Build. > > This needs to be resolved before 0.28. Any other ideas for solutions? Maybe sse the "version trick". IOW, if the user says use Module::Build VERSION; then you kick in the special behaviour (dying if no default). If they dont then you leave it. Cheers, Yves -- perl -Mre=3Ddebug -e "/just|another|perl|hacker/" |
From: Yitzchak Scott-T. <sth...@ef...> - 2006-04-06 19:32:13
|
On Thu, Apr 06, 2006 at 08:17:24PM +0200, demerphq wrote: > On 4/6/06, Randy W. Sims <ml...@th...> wrote: > > Yitzchak Scott-Thoennes wrote: > > > On Tue, Mar 07, 2006 at 05:33:49AM -0500, Randy W. Sims wrote: > > > > > >>Sorry for responding late to this, but won't this break exististing > > >>distributions? Distros that currently use y_n() without defaults will > > >>start die-ing when users upgrade M::B. > > > > > It doesn't break them in the sense that they were already broken for some users. But maybe it would be better to pick an arbitrary default? > > > > I don't think there is a reasonable default. I think the only way around > > the issue is to create new methods and deprecate the older ones or not > > require defaults. It's not reasonable to have Build scripts failing just > > because a user upgrades to a new version of Module::Build. > > > > This needs to be resolved before 0.28. Any other ideas for solutions? > > Maybe sse the "version trick". > > IOW, if the user says > > use Module::Build VERSION; > > then you kick in the special behaviour (dying if no default). If they > dont then you leave it. The problem that I tried to address is module authors not giving a default and not realizing that this dies when you try to do an unattended install. I want to force a default so they don't have the option to unknowingly cause some users a problem. |
From: Tyler M. <ty...@yi...> - 2006-04-06 19:35:30
|
Yitzchak Scott-Thoennes <sth...@ef...> wrote: > The problem that I tried to address is module authors not giving a > default and not realizing that this dies when you try to do an > unattended install. I want to force a default so they don't have > the option to unknowingly cause some users a problem. This is a problem with CPAN.pm as well; if you try to do the initial setup with PERL_MM_USE_DEFAULT=1, it loops forever on the "Select a mirror" prompt. :-/ I've been meaning to discuss this more / submit a patch, but my backlog has been insane lately... Cheers, Tyler |
From: Randy W. S. <ml...@th...> - 2006-04-06 19:59:53
|
Tyler MacDonald wrote: > Yitzchak Scott-Thoennes <sth...@ef...> wrote: > >>The problem that I tried to address is module authors not giving a >>default and not realizing that this dies when you try to do an >>unattended install. I want to force a default so they don't have >>the option to unknowingly cause some users a problem. > > > This is a problem with CPAN.pm as well; if you try to do the initial > setup with PERL_MM_USE_DEFAULT=1, it loops forever on the "Select a mirror" > prompt. :-/ I've been meaning to discuss this more / submit a patch, but my > backlog has been insane lately... We can: die "ERROR: This build script not safe for unattended installs. Please notify @{[$self->dist_author]} that they wrote a bad bad Build.PL. Please ask them to provide reasonable defaults or switch to the new ask() method." if $ENV{PERL_MM_USE_DEFAULT} && (called_without_default(y_n) || called_without_default(prompt); __END__ |
From: Tyler M. <ty...@yi...> - 2006-04-06 20:04:36
Attachments:
Deploy.PL
|
Randy W. Sims <ml...@th...> wrote: > > This is a problem with CPAN.pm as well; if you try to do the initial > >setup with PERL_MM_USE_DEFAULT=1, it loops forever on the "Select a mirror" > >prompt. :-/ I've been meaning to discuss this more / submit a patch, but my > >backlog has been insane lately... > We can: > > die "ERROR: This build script not safe for unattended installs. Please > notify @{[$self->dist_author]} that they wrote a bad bad Build.PL. > Please ask them to provide reasonable defaults or switch to the new > ask() method." > if $ENV{PERL_MM_USE_DEFAULT} > && (called_without_default(y_n) || called_without_default(prompt); Sure. What I really want though, is for CPAN.pm to be totally automatable. If you want a good chuckle, check out the attached hackety-hackety-hack I whipped together one afternoon to do an autobuild; the scary thing is it actually works. <g> - Tyler |
From: Yitzchak Scott-T. <sth...@ef...> - 2006-04-06 22:47:51
|
On Thu, Apr 06, 2006 at 03:57:07PM -0400, Randy W. Sims wrote: > Tyler MacDonald wrote: > >Yitzchak Scott-Thoennes <sth...@ef...> wrote: > > > >>The problem that I tried to address is module authors not giving a > >>default and not realizing that this dies when you try to do an > >>unattended install. I want to force a default so they don't have > >>the option to unknowingly cause some users a problem. > > > > > > This is a problem with CPAN.pm as well; if you try to do the initial > >setup with PERL_MM_USE_DEFAULT=1, it loops forever on the "Select a mirror" > >prompt. :-/ I've been meaning to discuss this more / submit a patch, but my > >backlog has been insane lately... > > We can: > > die "ERROR: This build script not safe for unattended installs. Please > notify @{[$self->dist_author]} that they wrote a bad bad Build.PL. > Please ask them to provide reasonable defaults or switch to the new > ask() method." > if $ENV{PERL_MM_USE_DEFAULT} > && (called_without_default(y_n) || called_without_default(prompt); > > __END__ That sounds like as good as it's going to get. |