diff options
| author | Mike McQuaid | 2018-01-29 17:35:52 +0000 | 
|---|---|---|
| committer | GitHub | 2018-01-29 17:35:52 +0000 | 
| commit | fdd3aa300099d67e6c60e1ac074459fd01c9bc75 (patch) | |
| tree | ac71b3e14d8a91bc390f9ea51328553a584ddbf2 | |
| parent | 91f980208e09e9bf035b60868492df8775411f87 (diff) | |
| parent | a9dc02a5863ac846cff144e989fb4e40ca11218a (diff) | |
| download | brew-fdd3aa300099d67e6c60e1ac074459fd01c9bc75.tar.bz2 | |
Merge pull request #3746 from alyssais/development_tools_bottle
Don't suggest install from bottle if not available
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 4 | 
2 files changed, 10 insertions, 3 deletions
| diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 7705f9d49..42c62338a 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -458,7 +458,7 @@ end  # if the user passes any flags/environment that would case a bottle-only  # installation on a system without build tools to fail  class BuildFlagsError < RuntimeError -  def initialize(flags) +  def initialize(flags, bottled: true)      if flags.length > 1        flag_text = "flags"        require_text = "require" @@ -467,13 +467,18 @@ class BuildFlagsError < RuntimeError        require_text = "requires"      end -    super <<~EOS +    message = <<~EOS.chomp!        The following #{flag_text}:          #{flags.join(", ")}        #{require_text} building tools, but none are installed.        #{DevelopmentTools.installation_instructions} +    EOS + +    message << <<~EOS.chomp! if bottled        Alternatively, remove the #{flag_text} to attempt bottle installation.      EOS + +    super message    end  end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 2105b9d71..a89da9ae9 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -70,8 +70,10 @@ class FormulaInstaller    # can proceed. Only invoked when the user has no developer tools.    def self.prevent_build_flags      build_flags = ARGV.collect_build_flags +    return if build_flags.empty? -    raise BuildFlagsError, build_flags unless build_flags.empty? +    all_bottled = ARGV.formulae.all?(&:bottled?) +    raise BuildFlagsError.new(build_flags, bottled: all_bottled)    end    def build_bottle? | 
