projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
06686c4
)
3824: Show stdout/stderr if shell cmd fails in install script.
author
Tom Clegg <tom@curoverse.com>
Wed, 22 Oct 2014 14:43:38 +0000
(10:43 -0400)
committer
Tom Clegg <tom@curoverse.com>
Wed, 22 Oct 2014 14:43:38 +0000
(10:43 -0400)
sdk/cli/bin/crunch-job
patch
|
blob
|
history
diff --git
a/sdk/cli/bin/crunch-job
b/sdk/cli/bin/crunch-job
index 369bc3e1ae6f021fbd809ecc7fa82c4da2a77ccc..9bad7ae54740c0ac368e9b75cf2c6781dc28afcc 100755
(executable)
--- a/
sdk/cli/bin/crunch-job
+++ b/
sdk/cli/bin/crunch-job
@@
-1718,6
+1718,7
@@
if (readlink ("$destdir.commit") eq $commit && -d $destdir) {
}
unlink "$destdir.commit";
}
unlink "$destdir.commit";
+open STDERR_ORIG, ">&STDERR";
open STDOUT, ">", "$destdir.log";
open STDERR, ">&STDOUT";
open STDOUT, ">", "$destdir.log";
open STDERR, ">&STDOUT";
@@
-1772,8
+1773,12
@@
sub shell_or_die
if ($ENV{"DEBUG"}) {
print STDERR "@_\n";
}
if ($ENV{"DEBUG"}) {
print STDERR "@_\n";
}
- system (@_) == 0
- or die "@_ failed: $! exit 0x".sprintf("%x",$?);
+ if (system (@_) != 0) {
+ my $exitstatus = sprintf("exit %d signal %d", $? >> 8, $? & 0x7f);
+ open STDERR, ">&STDERR_ORIG";
+ system ("cat $destdir.log >&2");
+ die "@_ failed ($!): $exitstatus";
+ }
}
__DATA__
}
__DATA__