aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-08-07 11:21:55 +0100
committerMike McQuaid2017-08-07 11:21:55 +0100
commite2070780f1d28756ba06c3aa623c63eb51c4826c (patch)
tree24c5eb42370d32279b5675c4df290277dca7661b /Library
parent8e89b9d9d06e52d183b9382fdb316139f1922f27 (diff)
downloadbrew-e2070780f1d28756ba06c3aa623c63eb51c4826c.tar.bz2
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.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/os/mac/formula_cellar_checks.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
index 66e038774..6d9330489 100644
--- a/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
+++ b/Library/Homebrew/extend/os/mac/formula_cellar_checks.rb
@@ -67,11 +67,19 @@ module FormulaCellarChecks
checker = LinkageChecker.new(keg, formula)
return unless checker.broken_dylibs?
- problem_if_output <<-EOS.undent
- The installation was broken.
- Broken dylib links found:
+ output = <<-EOS.undent
+ #{formula} has broken dynamic library links:
#{checker.broken_dylibs.to_a * "\n "}
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
def audit_installed