aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/caveats.rb
diff options
context:
space:
mode:
authorMisty De Meo2015-06-14 19:22:03 -0700
committerMisty De Meo2015-06-15 08:21:08 -0700
commit6d5632cd8fb9cc33a181f418de18fb115fb58096 (patch)
tree323d7092bfeb530818561f86e3b675b4b57239c0 /Library/Homebrew/caveats.rb
parent4c6da16221a580fa6297930f9dfd6f150caab1dc (diff)
downloadbrew-6d5632cd8fb9cc33a181f418de18fb115fb58096.tar.bz2
Formula: always print keg_only_text
Fixes Homebrew/homebrew#40724. Closes Homebrew/homebrew#40725. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Diffstat (limited to 'Library/Homebrew/caveats.rb')
-rw-r--r--Library/Homebrew/caveats.rb23
1 files changed, 22 insertions, 1 deletions
diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb
index 1df2e2644..4b1c2fcdd 100644
--- a/Library/Homebrew/caveats.rb
+++ b/Library/Homebrew/caveats.rb
@@ -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: