This reverts commit cc752e97f6dcfb3e58c9e753262926672edeb571.
Fixes#1585.
I will open a new issue for the actual underlying bug here (that
requirements aren't being handled correctly based on the stable/devel
spec used at installation time).
formula.bottle is nil when bottle.compatible_cellar? is false.
Use formula.bottle_specification.compatible_cellar? rather
than formula.bottle.compatible_cellar?.
- `brew update` should try to install `curl` before `git` on older
versions of Mac OS X where it is needed for accessing modern SSL
certificates.
- We don't need an HTTP mirror for `git` because `curl` will already be
installed before it is downloaded.
- Don't recommend GCC on Mac OS X versions where it can't be built with
the default system compiler.
- Start using the Homebrew `curl` on Mac OS X versions where it is
needed as soon as it is installed.
Don't ignore f.pour_bottle? and compatible_cellar? when pouring
a local bottle. --force-bottle may be used to pour a local
bottle that is incompatible, as it is for remote bottles.
This also helpfully avoids always building all dependencies from source
when passing `--build-bottle` or forcing all bottles when passing
`--force-bottle`.
Treat a `brew install` command as normal i.e. link by default unless
keg-only and only specify whether a keg should be linked when upgrading
or reinstalling. Also, adjust the naming accordingly so it's more
obvious that this is the case.
This means if a user has manually `brew unlink` or `brew link --force`d
something then that status will be preserved after they `brew upgrade`
or `brew reinstall` that formula.
This generally should make things that are keg-only by default easier
to swallow.
Only check runtime dependencies for version conflicts to avoid
having to create unnecessary duplicate formulae.
For example, a formula that needs to be built with ghc@8.0 should still
be allowed to have a build-time dependency on a cabal-install that was
itself built with ghc@8.2.
Improve the messaging around `brew install` when there's a possible user
action such as an `upgrade` or `link` and don't tell people to
`install --force` when it's unnecessary.
While I did this, tweak the output and function usage in a couple of
related places.
Some example output before this change:
```
Warning: openssl is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version
Warning: mysql@5.6 is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version
Warning: analog-6.0_1 already installed
Warning: bash-completion@2-2.5 already installed, it's just not linked.
```
Some example output after this change:
```
Error: openssl 1.0.2k is already installed
To upgrade to 1.0.2l, run `brew upgrade openssl`
Warning: mysql@5.6 5.6.36_1 is already installed
Warning: analog 6.0_1 is already installed
Warning: bash-completion@2 2.5 is already installed, it's just not linked.
You can use `brew link bash-completion@2` to link this version.
```