audit: use FormulaCellarChecks module.

Perform post-installation checks if a formula is installed.
Added for brew test-bot to be able to fail on bad Cellar installation.
This commit is contained in:
Mike McQuaid 2013-07-15 19:29:08 -07:00
parent 91c5c15a48
commit 897607b3d7
2 changed files with 19 additions and 2 deletions

View File

@ -1,6 +1,7 @@
require 'formula' require 'formula'
require 'utils' require 'utils'
require 'superenv' require 'superenv'
require 'formula_cellar_checks'
module Homebrew extend self module Homebrew extend self
def audit def audit
@ -75,6 +76,8 @@ class FormulaText
end end
class FormulaAuditor class FormulaAuditor
include FormulaCellarChecks
attr_reader :f, :text, :problems attr_reader :f, :text, :problems
BUILD_TIME_DEPS = %W[ BUILD_TIME_DEPS = %W[
@ -565,6 +568,21 @@ class FormulaAuditor
end end
def audit_check_output warning_and_description
return unless warning_and_description
warning, _ = *warning_and_description
problem warning
end
def audit_installed
audit_check_output(check_manpages)
audit_check_output(check_infopages)
audit_check_output(check_jars)
audit_check_output(check_non_libraries)
audit_check_output(check_non_executables(f.bin))
audit_check_output(check_non_executables(f.sbin))
end
def audit def audit
audit_file audit_file
audit_specs audit_specs
@ -574,6 +592,7 @@ class FormulaAuditor
audit_patches audit_patches
audit_text audit_text
audit_python audit_python
audit_installed
end end
private private

View File

@ -449,13 +449,11 @@ class FormulaInstaller
end end
def audit_bin def audit_bin
return unless f.bin.directory?
print_check_output(check_PATH(f.bin)) unless f.keg_only? print_check_output(check_PATH(f.bin)) unless f.keg_only?
print_check_output(check_non_executables(f.bin)) print_check_output(check_non_executables(f.bin))
end end
def audit_sbin def audit_sbin
return unless f.sbin.directory?
print_check_output(check_PATH(f.sbin)) unless f.keg_only? print_check_output(check_PATH(f.sbin)) unless f.keg_only?
print_check_output(check_non_executables(f.sbin)) print_check_output(check_non_executables(f.sbin))
end end