update: restore previous state when interrupted

Fixes #19460.
Closes #22375.
phantomjs: build from source.

Closes #22446
phantomjs: add bottles.
bottle: loosen prefix grep check.

/usr/local is in lots of things unrelated to Homebrew so be more specific and look for opt instead.
cmake, jpeg, mpfr: add missing cellar :any.
brew-test-bot: allow skipping bottle creation.
erlang: install manpages only in lib/erlang/man

Some erlang man pages have generic names that conflict with other
packages. The recommended installation location is lib/erlang/man, and
in fact they must be there for the "erl -man" command to find them.
Currently we use symlinks to make this work.

Instead let's only install them to lib/erlang/man and avoid all
conflicts. Users can add $(brew --prefix erlang)/lib/erlang/man to
MANPATH if they really want to use man to find them.

Fixes #21634.
Closes #22452.
erlang: update bottles
cpmtools 2.16

Closes #22455.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
bulk_extractor: update to 1.4 and change python-specific steps

Closes #22454.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
mlt 0.9.0

Closes #19781.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
tiny-fugue: fix to pcre_fullinfo calls to prevent tf warn about every custom variable

Closes #22382.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
SDL: fix build on Mavericks

Closes #22294.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
ilmbase 2.0.1

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
openexr 2.0.1

Closes #22442.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
openocd: add head build support

Closes #22447.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
alpine: fix build with Tcl 8.6
Move CompilerSelector logic into build env setup

This moves the CompilerSelector fails_with logic into the build
environment setup, making the compiler selection available before
performing actions that depends on knowing what the compiler is, e.g.
setting up PATH.

ENV.setup_build_environment now optionally takes a Formula argument
to provide the information necessary to do the fails_with, and the new
ENV.validate_cc! extracts the fails_with logic from Build.install.
superenv: don't set CC in ENV.clang/etc.

These methods were overriding CC and causing superenv to potentially
skip the compiler wrapper - especially if no wrapper existed for the
compiler being used, e.g. GNU GCCs.