exceptions: port to generic layer.
This commit is contained in:
parent
9f74ca80af
commit
270b0ec783
@ -372,36 +372,11 @@ class BuildToolsError < RuntimeError
|
|||||||
package_text = "a binary package"
|
package_text = "a binary package"
|
||||||
end
|
end
|
||||||
|
|
||||||
if MacOS.version >= "10.10"
|
|
||||||
xcode_text = <<-EOS.undent
|
|
||||||
To continue, you must install Xcode from the App Store,
|
|
||||||
or the CLT by running:
|
|
||||||
xcode-select --install
|
|
||||||
EOS
|
|
||||||
elsif MacOS.version == "10.9"
|
|
||||||
xcode_text = <<-EOS.undent
|
|
||||||
To continue, you must install Xcode from:
|
|
||||||
https://developer.apple.com/downloads/
|
|
||||||
or the CLT by running:
|
|
||||||
xcode-select --install
|
|
||||||
EOS
|
|
||||||
elsif MacOS.version >= "10.7"
|
|
||||||
xcode_text = <<-EOS.undent
|
|
||||||
To continue, you must install Xcode or the CLT from:
|
|
||||||
https://developer.apple.com/downloads/
|
|
||||||
EOS
|
|
||||||
else
|
|
||||||
xcode_text = <<-EOS.undent
|
|
||||||
To continue, you must install Xcode from:
|
|
||||||
https://developer.apple.com/xcode/downloads/
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<-EOS.undent
|
||||||
The following #{formula_text}:
|
The following #{formula_text}:
|
||||||
#{formulae.join(", ")}
|
#{formulae.join(", ")}
|
||||||
cannot be installed as #{package_text} and must be built from source.
|
cannot be installed as #{package_text} and must be built from source.
|
||||||
#{xcode_text}
|
#{DevelopmentTools.installation_instructions}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -419,36 +394,12 @@ class BuildFlagsError < RuntimeError
|
|||||||
require_text = "requires"
|
require_text = "requires"
|
||||||
end
|
end
|
||||||
|
|
||||||
if MacOS.version >= "10.10"
|
|
||||||
xcode_text = <<-EOS.undent
|
|
||||||
or install Xcode from the App Store, or the CLT by running:
|
|
||||||
xcode-select --install
|
|
||||||
EOS
|
|
||||||
elsif MacOS.version == "10.9"
|
|
||||||
xcode_text = <<-EOS.undent
|
|
||||||
or install Xcode from:
|
|
||||||
https://developer.apple.com/downloads/
|
|
||||||
or the CLT by running:
|
|
||||||
xcode-select --install
|
|
||||||
EOS
|
|
||||||
elsif MacOS.version >= "10.7"
|
|
||||||
xcode_text = <<-EOS.undent
|
|
||||||
or install Xcode or the CLT from:
|
|
||||||
https://developer.apple.com/downloads/
|
|
||||||
EOS
|
|
||||||
else
|
|
||||||
xcode_text = <<-EOS.undent
|
|
||||||
or install Xcode from:
|
|
||||||
https://developer.apple.com/xcode/downloads/
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<-EOS.undent
|
||||||
The following #{flag_text}:
|
The following #{flag_text}:
|
||||||
#{flags.join(", ")}
|
#{flags.join(", ")}
|
||||||
#{require_text} building tools, but none are installed.
|
#{require_text} building tools, but none are installed.
|
||||||
Either remove the #{flag_text} to attempt bottle installation,
|
#{DevelopmentTools.installation_instructions}
|
||||||
#{xcode_text}
|
Alternatively, remove the #{flag_text} to attempt bottle installation.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -457,23 +408,10 @@ end
|
|||||||
# the compilers available on the user's system
|
# the compilers available on the user's system
|
||||||
class CompilerSelectionError < RuntimeError
|
class CompilerSelectionError < RuntimeError
|
||||||
def initialize(formula)
|
def initialize(formula)
|
||||||
if MacOS.version > :tiger
|
|
||||||
super <<-EOS.undent
|
super <<-EOS.undent
|
||||||
#{formula.full_name} cannot be built with any available compilers.
|
#{formula.full_name} cannot be built with any available compilers.
|
||||||
To install this formula, you may need to:
|
#{DevelopmentTools.custom_installation_instructions}
|
||||||
brew install gcc
|
|
||||||
EOS
|
EOS
|
||||||
# Tiger doesn't ship with apple-gcc42, and this is required to build
|
|
||||||
# some software that doesn't build properly with FSF GCC.
|
|
||||||
else
|
|
||||||
super <<-EOS.undent
|
|
||||||
#{formula.full_name} cannot be built with any available compilers.
|
|
||||||
To install this formula, you may need to either:
|
|
||||||
brew install apple-gcc42
|
|
||||||
or:
|
|
||||||
brew install gcc
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user