Run post_install after linking and relocation

Closes Homebrew/homebrew#24962.
This commit is contained in:
Jack Nagel 2013-12-05 10:09:14 -06:00
parent 3d76a2c8df
commit 961e5a4e13

View File

@ -144,12 +144,6 @@ class FormulaInstaller
build_bottle_postinstall if ARGV.build_bottle? build_bottle_postinstall if ARGV.build_bottle?
begin
f.post_install
rescue
opoo "#{f.name} post_install failed. Rerun with `brew postinstall #{f.name}`."
end
opoo "Nothing was installed to #{f.prefix}" unless f.installed? opoo "Nothing was installed to #{f.prefix}" unless f.installed?
end end
@ -314,6 +308,8 @@ class FormulaInstaller
fix_install_names if OS.mac? fix_install_names if OS.mac?
post_install
ohai "Summary" if ARGV.verbose? or show_summary_heading ohai "Summary" if ARGV.verbose? or show_summary_heading
unless ENV['HOMEBREW_NO_EMOJI'] unless ENV['HOMEBREW_NO_EMOJI']
print "#{ENV['HOMEBREW_INSTALL_BADGE'] || "\xf0\x9f\x8d\xba"} " if MacOS.version >= :lion print "#{ENV['HOMEBREW_INSTALL_BADGE'] || "\xf0\x9f\x8d\xba"} " if MacOS.version >= :lion
@ -468,6 +464,15 @@ class FormulaInstaller
@show_summary_heading = true @show_summary_heading = true
end end
def post_install
f.post_install
rescue Exception => e
opoo "The post-install step did not complete successfully"
puts "You can try again using `brew postinstall #{f.name}`"
ohai e, e.backtrace if ARGV.debug?
@show_summary_heading = true
end
def pour def pour
if f.local_bottle_path if f.local_bottle_path
downloader = LocalBottleDownloadStrategy.new(f) downloader = LocalBottleDownloadStrategy.new(f)