From 6826cd68da17560e8440b880c05741a5820358a6 Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Mon, 4 Jan 2016 08:47:32 -0800 Subject: [PATCH] formula_installer: improve empty installation detection Use FormulaAuditor.audit_prefix_has_contents from audit.rb, which has better logic. Closes Homebrew/homebrew#47678. Signed-off-by: Mike McQuaid --- Library/Homebrew/formula_installer.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 8fae101372..e5fd590b7c 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -8,6 +8,7 @@ require "caveats" require "cleaner" require "formula_cellar_checks" require "install_renamed" +require "cmd/audit" require "cmd/postinstall" require "hooks/bottles" require "debrew" @@ -572,7 +573,11 @@ class FormulaInstaller end end - raise "Empty installation" if Dir["#{formula.prefix}/*"].empty? + auditor = FormulaAuditor.new(formula) + auditor.audit_prefix_has_contents + unless formula.prefix.exist? && auditor.problems.empty? + raise "Empty installation" + end rescue Exception ignore_interrupts do