Add HOMEBREW_FORCE_BOTTLE variable

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.
This commit is contained in:
Mike McQuaid 2018-07-20 14:28:14 +01:00
parent 333534d641
commit 3e93d4c6cf
5 changed files with 26 additions and 1 deletions

View File

@ -262,6 +262,14 @@ then
# Don't allow non-developers to customise Ruby warnings.
unset HOMEBREW_RUBY_WARNINGS
# Default non-developers to bottles on prerelease versions of macOS
# in default prefix.
if [[ "$HOMEBREW_PREFIX" = "/usr/local" &&
"$HOMEBREW_MACOS_VERSION_NUMERIC" -ge "101400" ]]
then
export HOMEBREW_FORCE_BOTTLE="1"
fi
fi
if [[ -z "$HOMEBREW_RUBY_WARNINGS" ]]

View File

@ -262,7 +262,8 @@ module HomebrewArgvExtension
end
def force_bottle?
include? "--force-bottle"
return false if ENV["HOMEBREW_NO_FORCE_BOTTLE"]
include?("--force-bottle") || !ENV["HOMEBREW_FORCE_BOTTLE"].nil?
end
def fetch_head?

View File

@ -170,6 +170,12 @@ Note that environment variables must have a value set to be detected. For exampl
directories. TextMate can handle this correctly in project mode, but many
editors will do strange things in this case.
* `HOMEBREW_FORCE_BOTTLE`:
If set, Homebrew will install from a bottle if it exists for the
current or newest version of macOS, even if it would not normally be used
for installation. Please do not file issues if you encounter errors when
using this environment variable.
* `HOMEBREW_FORCE_BREWED_CURL`:
If set, Homebrew will use a Homebrew-installed `curl` rather than the
system version.

View File

@ -1167,6 +1167,12 @@ Note that environment variables must have a value set to be detected. For exampl
directories. TextMate can handle this correctly in project mode, but many
editors will do strange things in this case.
* `HOMEBREW_FORCE_BOTTLE`:
If set, Homebrew will install from a bottle if it exists for the
current or newest version of macOS, even if it would not normally be used
for installation. Please do not file issues if you encounter errors when
using this environment variable.
* `HOMEBREW_FORCE_BREWED_CURL`:
If set, Homebrew will use a Homebrew-installed `curl` rather than the
system version.

View File

@ -1109,6 +1109,10 @@ If set, Homebrew will use this editor when editing a single formula, or several
\fINote:\fR \fBbrew edit\fR will open all of Homebrew as discontinuous files and directories\. TextMate can handle this correctly in project mode, but many editors will do strange things in this case\.
.
.TP
\fBHOMEBREW_FORCE_BOTTLE\fR
If set, Homebrew will install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation\. Please do not file issues if you encounter errors when using this environment variable\.
.
.TP
\fBHOMEBREW_FORCE_BREWED_CURL\fR
If set, Homebrew will use a Homebrew\-installed \fBcurl\fR rather than the system version\.
.