Cleanup FormulaInstaller caveats.
This commit is contained in:
parent
df2cdc681a
commit
da0c0ae97a
@ -143,13 +143,16 @@ class FormulaInstaller
|
|||||||
end
|
end
|
||||||
|
|
||||||
def caveats
|
def caveats
|
||||||
|
s = []
|
||||||
|
|
||||||
unless f.caveats.to_s.strip.empty?
|
unless f.caveats.to_s.strip.empty?
|
||||||
ohai "Caveats", f.caveats
|
s << f.caveats
|
||||||
@show_summary_heading = true
|
@show_summary_heading = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if f.keg_only?
|
if f.keg_only?
|
||||||
ohai 'Caveats', f.keg_only_text
|
s << "\n" unless s.empty?
|
||||||
|
s << f.keg_only_text
|
||||||
@show_summary_heading = true
|
@show_summary_heading = true
|
||||||
elsif ARGV.homebrew_developer?
|
elsif ARGV.homebrew_developer?
|
||||||
audit_bin
|
audit_bin
|
||||||
@ -159,22 +162,29 @@ class FormulaInstaller
|
|||||||
check_infopages
|
check_infopages
|
||||||
end
|
end
|
||||||
|
|
||||||
keg = Keg.new(f.prefix)
|
keg = Keg.new(f.prefix) rescue nil
|
||||||
if keg.completion_installed? :bash
|
keg ||= Keg.new(f.opt_prefix.realpath) rescue nil
|
||||||
ohai 'Caveats', <<-EOS.undent
|
keg ||= Keg.new(f.linked_keg.realpath) rescue nil
|
||||||
|
|
||||||
|
if keg and keg.completion_installed? :bash
|
||||||
|
s << "\n" unless s.empty?
|
||||||
|
s << <<-EOS.undent
|
||||||
Bash completion has been installed to:
|
Bash completion has been installed to:
|
||||||
#{HOMEBREW_PREFIX}/etc/bash_completion.d
|
#{HOMEBREW_PREFIX}/etc/bash_completion.d
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
if keg.completion_installed? :zsh
|
if keg and keg.completion_installed? :zsh
|
||||||
ohai 'Caveats', <<-EOS.undent
|
s << "\n" unless s.empty?
|
||||||
|
s << <<-EOS.undent
|
||||||
zsh completion has been installed to:
|
zsh completion has been installed to:
|
||||||
#{HOMEBREW_PREFIX}/share/zsh/site-functions
|
#{HOMEBREW_PREFIX}/share/zsh/site-functions
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
if f.plist or keg.plist_installed?
|
if f.plist or (keg and keg.plist_installed?)
|
||||||
|
s << "\n" unless s.empty?
|
||||||
|
|
||||||
destination = f.plist_startup ? '/Library/LaunchDaemons' \
|
destination = f.plist_startup ? '/Library/LaunchDaemons' \
|
||||||
: '~/Library/LaunchAgents'
|
: '~/Library/LaunchAgents'
|
||||||
|
|
||||||
@ -183,11 +193,10 @@ class FormulaInstaller
|
|||||||
plist_domain = f.plist_path.basename('.plist')
|
plist_domain = f.plist_path.basename('.plist')
|
||||||
destination_path = Pathname.new File.expand_path destination
|
destination_path = Pathname.new File.expand_path destination
|
||||||
plist_path = destination_path/plist_filename
|
plist_path = destination_path/plist_filename
|
||||||
s = []
|
|
||||||
|
|
||||||
# we readlink because this path probably doesn't exist since caveats
|
# we readlink because this path probably doesn't exist since caveats
|
||||||
# occurs before the link step of installation
|
# occurs before the link step of installation
|
||||||
if not (plist_path).file? and not (plist_path).symlink?
|
if (not plist_path.file?) and (not plist_path.symlink?)
|
||||||
if f.plist_startup
|
if f.plist_startup
|
||||||
s << "To have launchd start #{f.name} at startup:"
|
s << "To have launchd start #{f.name} at startup:"
|
||||||
s << " sudo mkdir -p #{destination}" unless destination_path.directory?
|
s << " sudo mkdir -p #{destination}" unless destination_path.directory?
|
||||||
@ -225,9 +234,9 @@ class FormulaInstaller
|
|||||||
s << " launchctl load #{plist_link}"
|
s << " launchctl load #{plist_link}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ohai 'Caveats', s
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ohai 'Caveats', s unless s.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
def finish
|
def finish
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user