cmd/link: change default_prefix? check to /usr/local check

Linking macOS-provided software breaks things only in `/usr/local`
prefixes, hence the `default_prefix?` check, which was included when our
only default prefix on macOS was `/usr/local`. Now that we install into
`/opt/homebrew` too, the default prefix check is needlessly restrictive.
This commit is contained in:
Carlo Cabrera 2021-10-14 22:13:55 +08:00
parent 976f9daa12
commit 19953c01b3
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -89,7 +89,7 @@ module Homebrew
end
if keg_only
if Homebrew.default_prefix? && formula.present? && formula.keg_only_reason.by_macos?
if HOMEBREW_PREFIX.to_s == "/usr/local" && formula.present? && formula.keg_only_reason.by_macos?
caveats = Caveats.new(formula)
opoo <<~EOS
Refusing to link macOS provided/shadowed software: #{keg.name}