Skip Menu |

This queue is for tickets about the CPANPLUS CPAN distribution.

Report information
The Basics
Id: 47250
Status: resolved
Priority: 0/
Queue: CPANPLUS

People
Owner: Nobody in particular
Requestors: pmoore6448 [...] gmail.com
Cc:
AdminCc:

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



Subject: cpanp always returns true when run in batch mode
Date: Mon, 22 Jun 2009 14:12:37 -0400
To: bug-cpanplus [...] rt.cpan.org
From: Phillip Moore <pmoore6448 [...] gmail.com>
Using cpanp from the perl-5.10.0 distribution, with no custom configuration whatsoever, I've found that it returns useless exit codes. root@efs-as5-3$ cpanp i Errno [MSG] No '/root/.cpanplus/custom-sources' dir, skipping custom sources [ERROR] 'Errno' does not contain an author part [ERROR] Cannot find 'Errno' in the module tree No such module: Errno No modules found to operate on! Nothing done [PWD = /home/pmoore/dev/efs/core/branches/test-suite-rewrite] root@efs-as5-3$ echo $? 0 This makes it very difficult to script installation, when you can't depend on the exit status to give you basic pass/fail information. The API return values are correct, though: root@efs-as5-3$ perl -MCPANPLUS -de 0 Loading DB routines from perl5db.pl version 1.3 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> $bool = install('Errno'); [MSG] No '/root/.cpanplus/custom-sources' dir, skipping custom sources [ERROR] No such module 'Errno' DB<2> x $bool 0 undef At least you get a false value when the installation fails. It would be nice if this were propogated to the exit value when cpanp is run non-interactively from the shell.
Hi Philip, On Mon Jun 22 14:13:04 2009, pmoore6448@gmail.com wrote: Show quoted text
> At least you get a false value when the installation fails. It would be > nice if this were propogated to the exit value when cpanp is run > non-interactively from the shell.
Thanks for the report. That's a very good suggestion. I've fixed this in trunk now, and it'll be part of the next CPANPLUS release (and 5.10.1). Cheers,