Fix universal binary handling in check_flat_namespace
This commit is contained in:
parent
0484bfe820
commit
7223f8ef74
@ -95,13 +95,14 @@ module FormulaCellarChecks
|
||||
keg = Keg.new(formula.prefix)
|
||||
flat_namespace_files = keg.mach_o_files.reject do |file|
|
||||
next true unless file.dylib?
|
||||
# FIXME: macho.header.flag? is not defined when macho
|
||||
# is a universal binary.
|
||||
next true if file.universal?
|
||||
|
||||
macho = MachO.open(file)
|
||||
if file.universal?
|
||||
macho.machos.map(&:header).all? { |h| h.flag? :MH_TWO_LEVEL }
|
||||
else
|
||||
macho.header.flag?(:MH_TWO_LEVEL)
|
||||
end
|
||||
end
|
||||
return if flat_namespace_files.empty?
|
||||
|
||||
<<~EOS
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user