diff options
| author | Jack Nagel | 2014-08-02 20:03:42 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-08-02 20:03:42 -0500 | 
| commit | d2f4f224a76f1dad5f6fbae2953078dbff5c9a31 (patch) | |
| tree | 4cc12229b09ee019f18554ab62c843a7b4175675 | |
| parent | 9ea723e77a369d1baa1f4b5b6aac136c365a705f (diff) | |
| download | homebrew-d2f4f224a76f1dad5f6fbae2953078dbff5c9a31.tar.bz2 | |
Partially revert e1f97e2 to pass new test cases
| -rw-r--r-- | Library/Homebrew/cxxstdlib.rb | 23 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_stdlib.rb | 4 | 
2 files changed, 16 insertions, 11 deletions
| diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb index 06599e7db..34ce92d99 100644 --- a/Library/Homebrew/cxxstdlib.rb +++ b/Library/Homebrew/cxxstdlib.rb @@ -23,7 +23,18 @@ class CxxStdlib    # libstdc++ is compatible across Apple compilers, but    # not between Apple and GNU compilers, or between GNU compiler versions    def compatible_with?(other) -    type.nil? || other.type.nil? || type == other.type +    return true if type.nil? || other.type.nil? + +    return false unless type == other.type + +    if apple_compiler? +      return false unless other.apple_compiler? +    else +      return false if other.apple_compiler? +      return false unless compiler.to_s[4..6] == other.compiler.to_s[4..6] +    end + +    true    end    def check_dependencies(formula, deps) @@ -50,21 +61,11 @@ class CxxStdlib      def apple_compiler?        true      end - -    def compatible_with?(other) -      super && other.apple_compiler? -    end    end    class GnuStdlib < CxxStdlib      def apple_compiler?        false      end - -    def compatible_with?(other) -      super && -        !other.apple_compiler? && -        compiler.to_s[4..6] == other.compiler.to_s[4..6] -    end    end  end diff --git a/Library/Homebrew/test/test_stdlib.rb b/Library/Homebrew/test/test_stdlib.rb index 55b10641c..50594465c 100644 --- a/Library/Homebrew/test/test_stdlib.rb +++ b/Library/Homebrew/test/test_stdlib.rb @@ -57,5 +57,9 @@ class CxxStdlibTests < Homebrew::TestCase    def test_compatibility_for_non_cxx_software      assert @purec.compatible_with?(@clang) +    assert @clang.compatible_with?(@purec) +    assert @purec.compatible_with?(@purec) +    assert @purec.compatible_with?(@gcc48) +    assert @gcc48.compatible_with?(@purec)    end  end | 
