formula_cellar_checks: reinstall broken bottles.

If we pour from a bottle and then immediately know it’s broken then
we should tell users how to resolve their issue and where to file a
issue to.

Inspired by https://github.com/Homebrew/homebrew-core/issues/16477.
This commit is contained in:
Mike McQuaid 2017-08-07 11:21:55 +01:00
parent 8e89b9d9d0
commit e2070780f1

View File

@ -67,11 +67,19 @@ module FormulaCellarChecks
checker = LinkageChecker.new(keg, formula) checker = LinkageChecker.new(keg, formula)
return unless checker.broken_dylibs? return unless checker.broken_dylibs?
problem_if_output <<-EOS.undent output = <<-EOS.undent
The installation was broken. #{formula} has broken dynamic library links:
Broken dylib links found:
#{checker.broken_dylibs.to_a * "\n "} #{checker.broken_dylibs.to_a * "\n "}
EOS EOS
tab = Tab.for_keg(keg)
if tab.poured_from_bottle
output += <<-EOS.undent
Rebuild this from source with:
brew reinstall --build-from-source #{formula}`
If that's successful, file an issue#{formula.tap ? " here:\n #{formula.tap.issues_url}" : "."}
EOS
end
problem_if_output output
end end
def audit_installed def audit_installed