aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-08-03 10:47:47 -0500
committerJack Nagel2014-08-03 10:47:47 -0500
commitfded4d0385171877bc6e60a2f265a2095be652da (patch)
tree4805718f5f512ddff8fda15f308e3bca7f61ffdd
parent5b38e891073fa324a09d31178c789b2453da54bf (diff)
downloadbrew-fded4d0385171877bc6e60a2f265a2095be652da.tar.bz2
Remove an is_a check
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb8
-rw-r--r--Library/Homebrew/formula.rb1
2 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index 583c3c639..3e95a4dc5 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -130,7 +130,13 @@ module SharedEnvExtension
# an alternate compiler, altering the value of environment variables.
# If no valid compiler is found, raises an exception.
def validate_cc!(formula)
- if formula.fails_with? compiler
+ # FIXME
+ # The compiler object we pass to fails_with? has no version information
+ # attached to it. This means that if we pass Compiler.new(:clang), the
+ # selector will be invoked if the formula fails with any version of clang.
+ # I think we can safely remove this conditional and always invoke the
+ # selector.
+ if formula.fails_with? Compiler.new(compiler)
send CompilerSelector.new(formula).compiler
end
end
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index fcad7ed54..4961c7980 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -232,7 +232,6 @@ class Formula
end
def fails_with? cc
- cc = Compiler.new(cc) unless cc.is_a? Compiler
(self.class.cc_failures || []).any? do |failure|
# Major version check distinguishes between, e.g.,
# GCC 4.7.1 and GCC 4.8.2, where a comparison is meaningless