Rather than relying on a `HOMEBREW_FORCE_BOTTLE` variable (which ends
up doing silly things like forcing bottle usage even when options are
provided) instead handle this at the `or_later` bottle detection
level so on prerelease versions of macOS any bottle looks like an
`or_later` bottle (unless various environment variables are set).
Fixes issues noted in:
https://github.com/Homebrew/brew/pull/4520#issuecomment-407229605
This does the equivalent of always passing `--force-bottle`. This will
be enabled by default on Mojave to allow people to avoid building
everything from source until our porting and bottling is a bit further
along.
- Ensure that `HOMEBREW_TEMP` is only displayed in `brew config` when
it's non-default.
- Attempt to create a missing `HOMEBREW_TEMP` directory rather than
failing to `realpath`. Note this will still fail on permissions errors
which is to be expected.
Because of this messing with the user's path:
https://github.com/Homebrew/brew/blob/
efc02899c851c62c9ce0d15dea9a231575d7d774/bin/brew#L68
brew uses /usr/bin/git over brewed git, even when the former is
problematically old.
There may also be other reasons a user prefers to use brewed git.
There was already a HOMEBREW_FORCE_BREWED_CURL option and a
HOMEBREW_SYSTEM_CURL_TOO_OLD check to set it. This mostly copies those
to implement HOMEBREW_FORCE_BREWED_GIT & HOMEBREW_SYSTEM_GIT_TOO_OLD.
See also: https://github.com/Linuxbrew/brew/issues/736
Rather than reusing `HOMEBREW_NO_AUTO_UPDATE` to indicate that we've
already made a check. This allows `HOMEBREW_NO_AUTO_UPDATE` to be
displayed properly by `brew config`.
- `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.
Move --prefix, --cellar to the top of brew.sh. Timings on master:
brew --prefix > /dev/null 0.05s user 0.03s system 46% cpu 0.165 total
brew --prefix > /dev/null 0.05s user 0.04s system 63% cpu 0.131 total
brew --prefix > /dev/null 0.04s user 0.03s system 72% cpu 0.104 total
brew --prefix > /dev/null 0.04s user 0.03s system 87% cpu 0.080 total
brew --prefix > /dev/null 0.04s user 0.03s system 81% cpu 0.080 total
brew --prefix > /dev/null 0.04s user 0.03s system 84% cpu 0.075 total
brew --prefix > /dev/null 0.04s user 0.03s system 83% cpu 0.080 total
brew --prefix > /dev/null 0.04s user 0.02s system 84% cpu 0.072 total
brew --prefix > /dev/null 0.04s user 0.03s system 86% cpu 0.072 total
brew --prefix > /dev/null 0.04s user 0.03s system 82% cpu 0.075 total
brew --prefix > /dev/null 0.04s user 0.03s system 85% cpu 0.072 total
brew --prefix > /dev/null 0.04s user 0.03s system 84% cpu 0.076 total
brew --prefix > /dev/null 0.04s user 0.03s system 85% cpu 0.074 total
brew --prefix > /dev/null 0.03s user 0.03s system 83% cpu 0.073 total
brew --prefix > /dev/null 0.04s user 0.02s system 83% cpu 0.072 total
brew --prefix > /dev/null 0.03s user 0.03s system 86% cpu 0.068 total
brew --prefix > /dev/null 0.04s user 0.03s system 82% cpu 0.080 total
brew --prefix > /dev/null 0.04s user 0.03s system 84% cpu 0.079 total
brew --prefix > /dev/null 0.04s user 0.02s system 83% cpu 0.070 total
brew --prefix > /dev/null 0.03s user 0.03s system 84% cpu 0.072 total
With the patch applied:
brew --prefix > /dev/null 0.02s user 0.02s system 24% cpu 0.157 total
brew --prefix > /dev/null 0.02s user 0.03s system 53% cpu 0.078 total
brew --prefix > /dev/null 0.02s user 0.02s system 64% cpu 0.056 total
brew --prefix > /dev/null 0.02s user 0.03s system 74% cpu 0.065 total
brew --prefix > /dev/null 0.01s user 0.02s system 73% cpu 0.049 total
brew --prefix > /dev/null 0.01s user 0.02s system 77% cpu 0.050 total
brew --prefix > /dev/null 0.01s user 0.02s system 64% cpu 0.054 total
brew --prefix > /dev/null 0.01s user 0.02s system 77% cpu 0.049 total
brew --prefix > /dev/null 0.01s user 0.02s system 56% cpu 0.061 total
brew --prefix > /dev/null 0.02s user 0.02s system 66% cpu 0.060 total
brew --prefix > /dev/null 0.01s user 0.02s system 62% cpu 0.057 total
brew --prefix > /dev/null 0.01s user 0.02s system 71% cpu 0.052 total
brew --prefix > /dev/null 0.02s user 0.03s system 67% cpu 0.063 total
brew --prefix > /dev/null 0.01s user 0.02s system 70% cpu 0.042 total
brew --prefix > /dev/null 0.02s user 0.02s system 68% cpu 0.056 total
brew --prefix > /dev/null 0.01s user 0.02s system 73% cpu 0.049 total
brew --prefix > /dev/null 0.01s user 0.02s system 62% cpu 0.058 total
brew --prefix > /dev/null 0.02s user 0.02s system 67% cpu 0.058 total
brew --prefix > /dev/null 0.01s user 0.02s system 73% cpu 0.043 total
brew --prefix > /dev/null 0.01s user 0.02s system 65% cpu 0.055 total
Prefer $XDG_CACHE_HOME if defined, falling back to $HOME/.cache.
The Mac cache location is not affected by this change.
Signed-off-by: Bob W. Hogg <rwhogg@linux.com>