Formula: always print keg_only_text
Fixes Homebrew/homebrew#40724. Closes Homebrew/homebrew#40725. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
This commit is contained in:
parent
4c6da16221
commit
6d5632cd8f
@ -9,7 +9,7 @@ class Caveats
|
||||
caveats = []
|
||||
s = f.caveats.to_s
|
||||
caveats << s.chomp + "\n" if s.length > 0
|
||||
caveats << f.keg_only_text if f.keg_only? && f.respond_to?(:keg_only_text)
|
||||
caveats << keg_only_text
|
||||
caveats << bash_completion_caveats
|
||||
caveats << zsh_completion_caveats
|
||||
caveats << fish_completion_caveats
|
||||
@ -31,6 +31,27 @@ class Caveats
|
||||
end.compact.first
|
||||
end
|
||||
|
||||
def keg_only_text
|
||||
return "" unless f.keg_only?
|
||||
|
||||
s = "This formula is keg-only, which means it was not symlinked into #{HOMEBREW_PREFIX}."
|
||||
s << "\n\n#{f.keg_only_reason.to_s}"
|
||||
if f.lib.directory? or f.include.directory?
|
||||
s <<
|
||||
<<-EOS.undent_________________________________________________________72
|
||||
|
||||
|
||||
Generally there are no consequences of this for you. If you build your
|
||||
own software and it requires this formula, you'll need to add to your
|
||||
build variables:
|
||||
|
||||
EOS
|
||||
s << " LDFLAGS: -L#{f.opt_lib}\n" if f.lib.directory?
|
||||
s << " CPPFLAGS: -I#{f.opt_include}\n" if f.include.directory?
|
||||
end
|
||||
s << "\n"
|
||||
end
|
||||
|
||||
def bash_completion_caveats
|
||||
if keg and keg.completion_installed? :bash then <<-EOS.undent
|
||||
Bash completion has been installed to:
|
||||
|
||||
@ -676,25 +676,3 @@ class FormulaInstaller
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
class Formula
|
||||
def keg_only_text
|
||||
s = "This formula is keg-only, which means it was not symlinked into #{HOMEBREW_PREFIX}."
|
||||
s << "\n\n#{keg_only_reason.to_s}"
|
||||
if lib.directory? or include.directory?
|
||||
s <<
|
||||
<<-EOS.undent_________________________________________________________72
|
||||
|
||||
|
||||
Generally there are no consequences of this for you. If you build your
|
||||
own software and it requires this formula, you'll need to add to your
|
||||
build variables:
|
||||
|
||||
EOS
|
||||
s << " LDFLAGS: -L#{opt_lib}\n" if lib.directory?
|
||||
s << " CPPFLAGS: -I#{opt_include}\n" if include.directory?
|
||||
end
|
||||
s << "\n"
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user