aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorXu Cheng2015-02-02 22:53:52 +0800
committerMike McQuaid2015-02-14 15:10:35 +0000
commitd0e2d126a1969c6cf3d975576108a8da2c618254 (patch)
tree1ca1656a21f3351254b53a32df28d99e30302e91 /Library/Homebrew/cmd
parent6d791acf22de5c8618cec01ce9ece633231cfad5 (diff)
downloadbrew-d0e2d126a1969c6cf3d975576108a8da2c618254.tar.bz2
audit: catch empty installations
Closes Homebrew/homebrew#36794. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/audit.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 8c874944e..4d0d7cb2f 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -668,6 +668,24 @@ class FormulaAuditor
end
end
+ def audit_prefix_has_contents
+ return unless formula.prefix.directory?
+
+ Pathname.glob("#{formula.prefix}/**/*") do |file|
+ next if file.directory?
+ basename = file.basename.to_s
+ next if Metafiles.copy?(basename)
+ next if %w[.DS_Store INSTALL_RECEIPT.json].include?(basename)
+ return
+ end
+
+ problem <<-EOS.undent
+ The installation seems to be empty. Please ensure the prefix
+ is set correctly and expected files are installed.
+ The prefix configure/make argument may be case-sensitive.
+ EOS
+ end
+
def audit_conditional_dep(dep, condition, line)
quoted_dep = quote_dep(dep)
dep = Regexp.escape(dep.to_s)
@@ -700,6 +718,7 @@ class FormulaAuditor
audit_text
text.without_patch.split("\n").each_with_index { |line, lineno| audit_line(line, lineno+1) }
audit_installed
+ audit_prefix_has_contents
end
private