caveats: show information based on build options

Fixes Homebrew/homebrew#44729.
Fixes Homebrew/homebrew#40863.
Closes Homebrew/homebrew#44779.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-10-09 19:43:31 +08:00
parent 51a585e0b4
commit 5b321ffb5a

View File

@ -7,8 +7,13 @@ class Caveats
def caveats def caveats
caveats = [] caveats = []
s = f.caveats.to_s begin
caveats << s.chomp + "\n" if s.length > 0 build, f.build = f.build, Tab.for_formula(f)
s = f.caveats.to_s
caveats << s.chomp + "\n" if s.length > 0
ensure
f.build = build
end
caveats << keg_only_text caveats << keg_only_text
caveats << bash_completion_caveats caveats << bash_completion_caveats
caveats << zsh_completion_caveats caveats << zsh_completion_caveats