Commit c0dc8908 by Mislav Marohnić

Fix false "BUILD FAILED" message when installing Rubinius

Installing Rubinius would print "BUILD FAILED" at the `bundle` step but
the installation would proceed nevertheless and finish successfully.

It turns out that the `command ...` expression will trigger the ERR trap
on failure even when it's a part of `||` list or a condition inside an
`if` statement. This defies how the ERR trap is supposed to work, so the
workaround is to execute it in a subshell which doesn't inherit the ERR
trap of its parent.
parent 8e16aab8
......@@ -743,11 +743,13 @@ bundle() {
}
isolated_gem_dependency() {
local output="$(command $1 2>/dev/null || true)"
if [ -z "$output" ]; then
set +E
( command $1 &>/dev/null ) || {
set -E
shift 1
isolated_gem_install "$@"
fi
}
set -E
}
isolated_gem_install() {
......
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