aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-12-21 18:03:24 -0600
committerJack Nagel2012-12-21 18:03:24 -0600
commit2b47739822a18a7dcf01102abd5a2dec2dcfa727 (patch)
tree0804a1cee602b5b10465ed781c73805482eaf22a /Library
parent847547167a02e9c0c5548ab13f4b5c9470440339 (diff)
downloadbrew-2b47739822a18a7dcf01102abd5a2dec2dcfa727.tar.bz2
doctor: print offending paths in check_for_gettext
c.f. Homebrew/homebrew#16688.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb30
1 files changed, 16 insertions, 14 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index b0327b79e..86428c28a 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -531,22 +531,24 @@ def check_which_pkg_config
end
def check_for_gettext
- if %w[lib/libgettextlib.dylib
- lib/libintl.dylib
- include/libintl.h ].any? { |f| File.exist? "#{HOMEBREW_PREFIX}/#{f}" }
- <<-EOS.undent
- gettext was detected in your PREFIX.
- The gettext provided by Homebrew is "keg-only", meaning it does not
- get linked into your PREFIX by default.
+ find_relative_paths("lib/libgettextlib.dylib",
+ "lib/libintl.dylib",
+ "include/libintl.h")
- If you `brew link gettext` then a large number of brews that don't
- otherwise have a `depends_on 'gettext'` will pick up gettext anyway
- during the `./configure` step.
+ return if @found.empty?
- If you have a non-Homebrew provided gettext, other problems will happen
- especially if it wasn't compiled with the proper architectures.
- EOS
+ # Our gettext formula will be caught by check_linked_keg_only_brews
+ f = Formula.factory("gettext") rescue nil
+ return if f and f.linked_keg.directory? and @found.all? do |path|
+ Pathname.new(path).realpath.to_s.start_with? "#{HOMEBREW_CELLAR}/gettext"
end
+
+ s = <<-EOS.undent_________________________________________________________72
+ gettext files detected at a system prefix
+ These files can cause compilation and link failures, especially if they
+ are compiled with improper architectures. Consider removing these files:
+ EOS
+ @found.inject(s) { |s, f| s << " #{f}\n" }
end
def check_for_iconv
@@ -570,7 +572,7 @@ def check_for_iconv
tl;dr: delete these files:
EOS
- @found.inject(s){|s, f| s << " #{f}" }
+ @found.inject(s){|s, f| s << " #{f}\n" }
end
end
end