diff options
| author | Jack Nagel | 2013-03-11 22:54:15 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-03-12 13:55:15 -0500 |
| commit | cc08d08d74f20d72ba378fed3bbc53390be0b97d (patch) | |
| tree | 3fb0297c7479f93677b77c173c75f13b35704128 /Library/Homebrew/formula.rb | |
| parent | c2e642f9c12330cb41d2350ab30199da6c1b7e6f (diff) | |
| download | brew-cc08d08d74f20d72ba378fed3bbc53390be0b97d.tar.bz2 | |
Switch compilers when no build is specified
Given the current state of OS X compilers, the original fails_with
behavior is becoming less useful, mostly resulting in build failures
each time the compiler is updated. So make the following changes:
When a build is specified, we retain the old behavior: switch compilers
if the available compiler is <= the build, don't switch if it is > the
build.
When no build is specified, unconditionally switch compilers, and don't
output the advice message. This allows us to mark formulae as
perpetually failing, avoiding the need to update formulae each time a
new compiler build is made available.
As a bonus, this makes the logic much easier to reason about.
Closes Homebrew/homebrew#18175.
Diffstat (limited to 'Library/Homebrew/formula.rb')
| -rw-r--r-- | Library/Homebrew/formula.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2186b4a74..9234b45df 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -200,10 +200,8 @@ class Formula def fails_with? cc return false if self.class.cc_failures.nil? cc = Compiler.new(cc) unless cc.is_a? Compiler - return self.class.cc_failures.find do |failure| - next unless failure.compiler == cc.name - failure.build.zero? or \ - (failure.build >= cc.build or not ARGV.homebrew_developer?) + self.class.cc_failures.find do |failure| + failure.compiler == cc.name && failure.build >= cc.build end end |
