Merge pull request #11540 from MikeMcQuaid/brew_doctor_apple_silicon
diagnostic: hide some warnings on Apple Silicon.
This commit is contained in:
commit
f18f5e404c
@ -487,7 +487,16 @@ module Homebrew
|
||||
#{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin
|
||||
/Applications/Server.app/Contents/ServerRoot/usr/bin
|
||||
/Applications/Server.app/Contents/ServerRoot/usr/sbin
|
||||
].map(&:downcase)
|
||||
]
|
||||
if OS.mac? && Hardware::CPU.physical_cpu_arm64?
|
||||
allowlist += %W[
|
||||
#{HOMEBREW_MACOS_ARM_DEFAULT_PREFIX}/bin
|
||||
#{HOMEBREW_MACOS_ARM_DEFAULT_PREFIX}/sbin
|
||||
#{HOMEBREW_DEFAULT_PREFIX}/bin
|
||||
#{HOMEBREW_DEFAULT_PREFIX}/sbin
|
||||
]
|
||||
end
|
||||
allowlist.map!(&:downcase)
|
||||
|
||||
paths.each do |p|
|
||||
next if allowlist.include?(p.downcase) || !File.directory?(p)
|
||||
|
@ -316,10 +316,18 @@ module Homebrew
|
||||
end
|
||||
|
||||
if gettext&.linked_keg&.directory?
|
||||
homebrew_owned = @found.all? do |path|
|
||||
Pathname.new(path).realpath.to_s.start_with? "#{HOMEBREW_CELLAR}/gettext"
|
||||
allowlist = ["#{HOMEBREW_CELLAR}/gettext"]
|
||||
if Hardware::CPU.physical_cpu_arm64?
|
||||
allowlist += %W[
|
||||
#{HOMEBREW_MACOS_ARM_DEFAULT_PREFIX}/Cellar/gettext
|
||||
#{HOMEBREW_DEFAULT_PREFIX}/Cellar/gettext
|
||||
]
|
||||
end
|
||||
|
||||
return if @found.all? do |path|
|
||||
realpath = Pathname.new(path).realpath.to_s
|
||||
allowlist.any? { |rack| realpath.start_with?(rack) }
|
||||
end
|
||||
return if homebrew_owned
|
||||
end
|
||||
|
||||
inject_file_list @found, <<~EOS
|
||||
|
Loading…
x
Reference in New Issue
Block a user