diff options
| author | Mike McQuaid | 2017-07-21 09:06:50 +0100 |
|---|---|---|
| committer | GitHub | 2017-07-21 09:06:50 +0100 |
| commit | e0560ff363d5efa177cf567281e78f73848557b4 (patch) | |
| tree | 99189f69078f5239cf516c6935839f0e283a5d91 /Library | |
| parent | 997260da541cf4d1be8769e8c7960372bd6a92f0 (diff) | |
| parent | bd06a7926cbcdeb8d8d80f6eb46b5bde27b365e4 (diff) | |
| download | brew-e0560ff363d5efa177cf567281e78f73848557b4.tar.bz2 | |
Merge pull request #2919 from baughj/add-check-for-build-from-source
Add check for build from source
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 11 | ||||
| -rw-r--r-- | Library/Homebrew/test/diagnostic_spec.rb | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index a5adfeb63..ceb6ad4d1 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -98,6 +98,17 @@ module Homebrew EOS end + def check_build_from_source + return unless ENV["HOMEBREW_BUILD_FROM_SOURCE"] + + <<-EOS.undent + You have HOMEBREW_BUILD_FROM_SOURCE set. This environment variable is + intended for use by Homebrew developers. If you are encountering errors, + please try unsetting this. Please do not file issues if you encounter + errors when using this environment variable. + EOS + end + # See https://github.com/Homebrew/legacy-homebrew/pull/9986 def check_path_for_trailing_slashes bad_paths = PATH.new(ENV["HOMEBREW_PATH"]).select { |p| p.end_with?("/") } diff --git a/Library/Homebrew/test/diagnostic_spec.rb b/Library/Homebrew/test/diagnostic_spec.rb index 058b9823c..8a25413ed 100644 --- a/Library/Homebrew/test/diagnostic_spec.rb +++ b/Library/Homebrew/test/diagnostic_spec.rb @@ -12,6 +12,12 @@ describe Homebrew::Diagnostic::Checks do .to match("Some directories in your path end in a slash") end + specify "#check_build_from_source" do + ENV["HOMEBREW_BUILD_FROM_SOURCE"] = "1" + expect(subject.check_build_from_source) + .to match("You have HOMEBREW_BUILD_FROM_SOURCE set.") + end + specify "#check_for_anaconda" do mktmpdir do |path| anaconda = "#{path}/anaconda" |
