Reorganize post-install checks so we can share more code

This commit is contained in:
Jack Nagel 2014-10-13 23:13:01 -05:00
parent 634d67690b
commit b05351d0b2
3 changed files with 19 additions and 51 deletions

View File

@ -554,19 +554,6 @@ class FormulaAuditor
problem(output) if output problem(output) if output
end 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_generic_executables(f.bin))
audit_check_output(check_non_executables(f.sbin))
audit_check_output(check_generic_executables(f.sbin))
audit_check_output(check_shadowed_headers)
audit_check_output(check_easy_install_pth(f.lib))
end
def audit def audit
audit_file audit_file
audit_specs audit_specs

View File

@ -133,6 +133,19 @@ module FormulaCellarChecks
EOS EOS
end 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_generic_executables(f.bin))
audit_check_output(check_non_executables(f.sbin))
audit_check_output(check_generic_executables(f.sbin))
audit_check_output(check_shadowed_headers)
audit_check_output(check_easy_install_pth(f.lib))
end
private private
def relative_glob(dir, pattern) def relative_glob(dir, pattern)

View File

@ -378,14 +378,7 @@ class FormulaInstaller
def caveats def caveats
return if only_deps? return if only_deps?
if ARGV.homebrew_developer? and not f.keg_only? audit_installed if ARGV.homebrew_developer? and not f.keg_only?
audit_bin
audit_sbin
audit_lib
audit_man
audit_info
audit_include
end
c = Caveats.new(f) c = Caveats.new(f)
@ -637,42 +630,17 @@ class FormulaInstaller
FileUtils.rm_rf f.bottle_prefix FileUtils.rm_rf f.bottle_prefix
end end
## checks def audit_check_output(output)
def print_check_output(output)
if output if output
opoo output opoo output
@show_summary_heading = true @show_summary_heading = true
end end
end end
def audit_bin def audit_installed
print_check_output(check_PATH(f.bin)) audit_check_output(check_PATH(f.bin))
print_check_output(check_non_executables(f.bin)) audit_check_output(check_PATH(f.sbin))
print_check_output(check_generic_executables(f.bin)) super
end
def audit_sbin
print_check_output(check_PATH(f.sbin))
print_check_output(check_non_executables(f.sbin))
print_check_output(check_generic_executables(f.sbin))
end
def audit_lib
print_check_output(check_jars)
print_check_output(check_non_libraries)
end
def audit_man
print_check_output(check_manpages)
end
def audit_info
print_check_output(check_infopages)
end
def audit_include
print_check_output(check_shadowed_headers)
end end
private private