aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/exceptions.rb
diff options
context:
space:
mode:
authorAlyssa Ross2018-01-28 22:44:03 +0000
committerAlyssa Ross2018-01-28 22:47:39 +0000
commita9dc02a5863ac846cff144e989fb4e40ca11218a (patch)
treea739dad7bfcb9376fe3770f851a540279a594096 /Library/Homebrew/exceptions.rb
parent9f4b4a169975a5bb9272974963d4d37d873affc6 (diff)
downloadbrew-a9dc02a5863ac846cff144e989fb4e40ca11218a.tar.bz2
Don't suggest install from bottle if not available
It only makes sense to tell a user to try installing from a bottle if there are bottles available for them to install for all the formulae they specified.
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
-rw-r--r--Library/Homebrew/exceptions.rb9
1 files changed, 7 insertions, 2 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