mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
Rename compiler attribute to name
This commit is contained in:
parent
2fedd5b09a
commit
e5d6247ae7
@ -12,7 +12,7 @@ class Compiler < Struct.new(:name, :version, :priority)
|
|||||||
end
|
end
|
||||||
|
|
||||||
class CompilerFailure
|
class CompilerFailure
|
||||||
attr_reader :compiler, :major_version
|
attr_reader :name, :major_version
|
||||||
attr_rw :cause, :version
|
attr_rw :cause, :version
|
||||||
|
|
||||||
# Allows Apple compiler `fails_with` statements to keep using `build`
|
# Allows Apple compiler `fails_with` statements to keep using `build`
|
||||||
@ -29,20 +29,20 @@ class CompilerFailure
|
|||||||
# Non-Apple compilers are in the format fails_with compiler => version
|
# Non-Apple compilers are in the format fails_with compiler => version
|
||||||
if spec.is_a?(Hash)
|
if spec.is_a?(Hash)
|
||||||
_, major_version = spec.first
|
_, major_version = spec.first
|
||||||
compiler = "gcc-#{major_version}"
|
name = "gcc-#{major_version}"
|
||||||
# so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible
|
# so fails_with :gcc => '4.8' simply marks all 4.8 releases incompatible
|
||||||
version = "#{major_version}.999"
|
version = "#{major_version}.999"
|
||||||
else
|
else
|
||||||
compiler = spec
|
name = spec
|
||||||
version = 9999
|
version = 9999
|
||||||
major_version = nil
|
major_version = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
new(compiler, version, major_version, &block)
|
new(name, version, major_version, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(compiler, version, major_version, &block)
|
def initialize(name, version, major_version, &block)
|
||||||
@compiler = compiler
|
@name = name
|
||||||
@version = version
|
@version = version
|
||||||
@major_version = major_version
|
@major_version = major_version
|
||||||
instance_eval(&block) if block_given?
|
instance_eval(&block) if block_given?
|
||||||
|
@ -235,7 +235,7 @@ class Formula
|
|||||||
(self.class.cc_failures || []).any? do |failure|
|
(self.class.cc_failures || []).any? do |failure|
|
||||||
# Major version check distinguishes between, e.g.,
|
# Major version check distinguishes between, e.g.,
|
||||||
# GCC 4.7.1 and GCC 4.8.2, where a comparison is meaningless
|
# GCC 4.7.1 and GCC 4.8.2, where a comparison is meaningless
|
||||||
failure.compiler == cc.name && failure.major_version == cc.major_version &&
|
failure.name == cc.name && failure.major_version == cc.major_version &&
|
||||||
failure.version >= (cc.version || 0)
|
failure.version >= (cc.version || 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user