Commit c0dc8908 authored by Mislav Marohnić's avatar Mislav Marohnić
Browse files

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
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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() {