Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HOMEBREW_FORCE_BOTTLE variable #4520

Merged
merged 1 commit into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]]
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/extend/ARGV.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ def flag?(flag)
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?
Expand Down
6 changes: 6 additions & 0 deletions Library/Homebrew/manpages/brew.1.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions manpages/brew.1
Original file line number Diff line number Diff line change
Expand Up @@ -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\.
.
Expand Down