Skip Menu |

This queue is for tickets about the Module-Install CPAN distribution.

Report information
The Basics
Id: 30382
Status: open
Priority: 0/
Queue: Module-Install

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

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



Subject: Don't continue after errors, without confirmation
Currently Module::AutoInstall will proceed after a module fails to install. This is bad, because often the user will not know other than maybe catching what looks like a fatal error message flying past. Worse, if the module is required by multiple packages which are in the dependency list then this can be repeated multiple times, giving the appearance of looping. After an auto-install, M::AI should check that the module has been installed successfully. It should be possible to force install if there was a problem, while the test errors are still on the screen. If it didn't install successfully, the user should be prompted as to whether they want to proceed with installing other dependencies or stop and fix the situation.
Subject: Re: [rt.cpan.org #30382] Don't continue after errors, without confirmation
Date: Thu, 1 Nov 2007 11:17:50 +1100
To: bug-Module-Install [...] rt.cpan.org
From: "Adam Kennedy" <adamkennedybackup [...] gmail.com>
I believe this is a CPAN issue, not a M:I issue. On 31/10/2007, via RT <bug-Module-Install@rt.cpan.org> wrote: Show quoted text
> > > Wed Oct 31 00:53:09 2007: Request 30382 was acted upon. > Transaction: Ticket created by SAMV > Queue: Module-Install > Subject: Don't continue after errors, without confirmation > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: SAMV@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=30382 > > > > Currently Module::AutoInstall will proceed after a module fails to > install. This is bad, because often the user will not know other than > maybe catching what looks like a fatal error message flying past. > Worse, if the module is required by multiple packages which are in the > dependency list then this can be repeated multiple times, giving the > appearance of looping. > > After an auto-install, M::AI should check that the module has been > installed successfully. It should be possible to force install if there > was a problem, while the test errors are still on the screen. If it > didn't install successfully, the user should be prompted as to whether > they want to proceed with installing other dependencies or stop and fix > the situation. >
From: SAMV [...] cpan.org
On Wed Oct 31 20:18:16 2007, adamkennedybackup@gmail.com wrote: Show quoted text
> I believe this is a CPAN issue, not a M:I issue.
The loop that would get the logic is in Module::AutoInstall::_install_cpan. See attached patch. The _install_cpanplus loop should get the same additions too. Sam.
--- Module-Install-0.67.orig/lib/Module/AutoInstall.pm 2007-05-09 18:52:46.000000000 +1200 +++ Module-Install-0.67/lib/Module/AutoInstall.pm 2007-11-01 15:16:34.000000000 +1300 @@ -478,8 +478,11 @@ delete $INC{$inc}; } - my $rv = $args{force} ? CPAN::Shell->force( install => $pkg ) - : CPAN::Shell->install($pkg); + my $force = $args{force}; + +try: + my $rv = $force ? CPAN::Shell->force( install => $pkg ) + : CPAN::Shell->install($pkg); $rv ||= eval { $CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, ) ->{install} @@ -493,6 +496,17 @@ else { print "*** $pkg installation failed.\n"; $success = 0; + if (!$force and + _prompt( "Force install of $pkg?", 'n' ) =~ /^[Yy]/ + ) { + $force = 1; + goto try; + } + if ( @modules and + _prompt( "Continue with other dependencies?", 'n' ) =~ /^[Nn]/ + ) { + @modules=(); + } } $installed += $success;