link: prevent :provided_by_macos links everywhere.

We've not seen complaints about these and they are the default behaviour
on High Sierra and Mojave so it's easier to apply them consistently
everywhere.
This commit is contained in:
Mike McQuaid 2018-12-06 13:59:28 +00:00
parent 864a6b53d3
commit 2a346241c2
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -78,28 +78,14 @@ module Homebrew
if keg_only
if Homebrew.default_prefix?
f = keg.to_formula
caveats = Caveats.new(f)
if f.keg_only_reason.reason == :provided_by_macos &&
(MacOS.version >= :mojave ||
MacOS::Xcode.version >= "10.0" ||
MacOS::CLT.version >= "10.0")
if f.keg_only_reason.reason == :provided_by_macos
caveats = Caveats.new(f)
opoo <<~EOS
Refusing to link macOS-provided software: #{keg.name}
#{caveats.keg_only_text(skip_reason: true).strip}
EOS
next
end
if keg.name.start_with?("openssl", "libressl")
opoo <<~EOS
Refusing to link: #{keg.name}
Linking keg-only #{keg.name} means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's #{keg.name}.
#{caveats.keg_only_text(skip_reason: true).strip}
EOS
next
end
end
unless args.force?