Commit cbeda052 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

Use "bash -o pipefail" to make sure we catch errors on both sides of the pipe

parent 170af2c2
......@@ -215,7 +215,7 @@ sub run {
return if ($self->param('skip_dump'));
# OK, we can dump
if(my $return_value = system($cmd)) {
if(my $return_value = system(bash => (-o => 'pipefail', -c => $cmd))) {
die "system( $cmd ) failed: $return_value";
}
}
......
......@@ -130,7 +130,7 @@ sub run {
. 'mysql '
. $self->mysql_conn_from_dbc($dest_dbc);
if(my $return_value = system($cmd)) { # NB: unfortunately, this code won't catch many errors because of the pipe
if(my $return_value = system(bash => (-o => 'pipefail', -c => $cmd))) {
$return_value >>= 8;
die "system( $cmd ) failed: $return_value";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment