Merge keg_only? blocks in installer.

This commit is contained in:
Adam Vandenberg 2010-05-02 18:12:48 -07:00
parent 639ea39d9c
commit 48a5f6ca79

View File

@ -130,6 +130,10 @@ def install f
raise "Nothing was installed to #{f.prefix}" unless f.installed? raise "Nothing was installed to #{f.prefix}" unless f.installed?
if f.keg_only?
ohai 'Caveats', text_for_keg_only_formula(f)
show_summary_heading = true
else
# warn the user if stuff was installed outside of their PATH # warn the user if stuff was installed outside of their PATH
paths = ENV['PATH'].split(':').collect{|p| File.expand_path p} paths = ENV['PATH'].split(':').collect{|p| File.expand_path p}
[f.bin, f.sbin].each do |bin| [f.bin, f.sbin].each do |bin|
@ -142,12 +146,9 @@ def install f
show_summary_heading = true show_summary_heading = true
end end
end end
end unless f.keg_only? end
if f.keg_only? # link from Cellar to Prefix
ohai 'Caveats', text_for_keg_only_formula(f)
show_summary_heading = true
else
begin begin
Keg.new(f.prefix).link Keg.new(f.prefix).link
rescue Exception => e rescue Exception => e