doctor: print offending paths in check_for_gettext
c.f. Homebrew/homebrew#16688.
This commit is contained in:
parent
847547167a
commit
2b47739822
@ -531,22 +531,24 @@ def check_which_pkg_config
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_for_gettext
|
def check_for_gettext
|
||||||
if %w[lib/libgettextlib.dylib
|
find_relative_paths("lib/libgettextlib.dylib",
|
||||||
lib/libintl.dylib
|
"lib/libintl.dylib",
|
||||||
include/libintl.h ].any? { |f| File.exist? "#{HOMEBREW_PREFIX}/#{f}" }
|
"include/libintl.h")
|
||||||
<<-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.
|
|
||||||
|
|
||||||
If you `brew link gettext` then a large number of brews that don't
|
return if @found.empty?
|
||||||
otherwise have a `depends_on 'gettext'` will pick up gettext anyway
|
|
||||||
during the `./configure` step.
|
|
||||||
|
|
||||||
If you have a non-Homebrew provided gettext, other problems will happen
|
# Our gettext formula will be caught by check_linked_keg_only_brews
|
||||||
especially if it wasn't compiled with the proper architectures.
|
f = Formula.factory("gettext") rescue nil
|
||||||
EOS
|
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
|
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
|
end
|
||||||
|
|
||||||
def check_for_iconv
|
def check_for_iconv
|
||||||
@ -570,7 +572,7 @@ def check_for_iconv
|
|||||||
|
|
||||||
tl;dr: delete these files:
|
tl;dr: delete these files:
|
||||||
EOS
|
EOS
|
||||||
@found.inject(s){|s, f| s << " #{f}" }
|
@found.inject(s){|s, f| s << " #{f}\n" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user