Subject: | Sysadm-Install-0.36 tap with {raise_error => 1} doesn't work correctly |
Date: | Tue, 10 May 2011 20:35:22 +0000 |
To: | "bug-Sysadm-Install [...] rt.cpan.org" <bug-Sysadm-Install [...] rt.cpan.org> |
From: | "Thadden, Kai von" <kai.von.thadden [...] hp.com> |
Module version is: Sysadm-Install-0.36
Sample:
#!/opt/perl_64/bin/perl
use warnings;
use strict;
use Carp;
use Getopt::Long;
use Log::Log4perl qw(:easy);
use Sysadm::Install qw(:all);
tap({raise_error => 1}, "ls");
returns
tap 'ls' 2>/tmp/JyeDMqFoaQ.dat | | failed (No such file or directory) at
./minitest.pl line 14
source code shows that it is easy to fix
my $exit_code = $?;
if($opts->{raise_error}) {
LOGCROAK("tap $cmd | failed ($!)");
}
Proposed fix
my $exit_code = $?;
if( $exit_code != 0 && $opts->{raise_error}) {
LOGCROAK("tap $cmd | failed ($!)");
}
Best regards and thank you for this very useful module
Kai
Message body not shown because it is not plain text.