aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2016-03-16 13:55:40 +0000
committerGravatar Lukacs Berki <lberki@google.com>2016-03-17 10:03:56 +0000
commitb2973419c9b018064bbc45f9fdf5c135ee304758 (patch)
treea1b3c371665b25b946a64b9bbff6edcf0d90a2f4 /scripts
parentb78bbd5dd53ecaeb8a736b69ecd3f014232da1d4 (diff)
Make bootstrap process wrapper honor '-' as stdout/stderr
For the process wrapper the value '-' has a special meaning as file name to which stdout/stderr are to be redirected: do not redirect. However, the simple shell script that serves as process wrapper during the bootstrap phase was not aware of this special meaning, resulting in loss of useful process output, which is especially annoying during bootstrap. Fix this. -- Change-Id: Ifcf84e9000d74dafc69b675f192c1fc1cce484e8 Reviewed-on: https://bazel-review.googlesource.com/#/c/3081 MOS_MIGRATED_REVID=117338558
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bootstrap/compile.sh24
1 files changed, 23 insertions, 1 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index b7a5f3f18c..4f3413d4b1 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -199,7 +199,29 @@ stdout="$1"
stderr="$2"
shift 2
-"$@" 2>"$stderr" >"$stdout"
+if [ "$stdout" = "-" ]
+then
+ if [ "$stderr" = "-" ]
+ then
+ "$@"
+ exit $?
+ else
+ "$@" 2>"$stderr"
+ exit $?
+ fi
+else
+ if [ "$stderr" = "-" ]
+ then
+ "$@" >"$stdout"
+ exit $?
+ else
+ "$@" 2>"$stderr" >"$stdout"
+ exit $?
+ fi
+fi
+
+
+"$@"
exit $?
EOF
chmod 0755 ${ARCHIVE_DIR}/_embedded_binaries/process-wrapper${EXE_EXT}