[Bps-public-commit] r10377 - bpsbuilder/BPB/lib/BPB
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Jan 17 04:30:18 EST 2008
Author: sunnavy
Date: Thu Jan 17 04:30:17 2008
New Revision: 10377
Modified:
bpsbuilder/BPB/lib/BPB/Util.pm
Log:
removed ignore_failure arg
Modified: bpsbuilder/BPB/lib/BPB/Util.pm
==============================================================================
--- bpsbuilder/BPB/lib/BPB/Util.pm (original)
+++ bpsbuilder/BPB/lib/BPB/Util.pm Thu Jan 17 04:30:17 2008
@@ -7,28 +7,27 @@
my $log = Log::Log4perl->get_logger('BPB::Util');
+=head2 run
+
+a wrapper of run3 sub in IPC::Run3.
+
+=cut
+
sub run {
- my $class = shift;
- my $cmd = shift;
- my $ignore_failure = shift;
+ my $class = shift;
+ my $cmd = shift;
my ( $out, $err );
$log->info( "run cmd:\n" . join ' ', @$cmd );
run3( $cmd, \*STDIN, \$out, \$err );
$log->info("run output:\n$out") if $out;
- $log->warn("run err:\n$err" ) if $err;
+ $log->warn("run err:\n$err") if $err;
if ($?) {
- if ($ignore_failure) {
- return;
- }
- else {
- $log->error( 'failed to run ' . join(' ', @$cmd ) . ":$?" );
- }
- }
- else {
- return ( $out, $err );
+ $log->error( 'failed to run ' . join( ' ', @$cmd ) . ":$?" );
}
+ return ( $out, $err );
+
}
1;
More information about the Bps-public-commit
mailing list