brew doctor: add check for stray .pc files
This commit is contained in:
parent
4e65175564
commit
f4cd85aa49
@ -89,6 +89,30 @@ def check_for_stray_static_libs
|
|||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_for_stray_pcs
|
||||||
|
unbrewed_pcs = Dir['/usr/local/lib/pkgconfig/*.pc'].select { |f| File.file? f and not File.symlink? f }
|
||||||
|
|
||||||
|
# Package-config files which are generally OK should be added to this list,
|
||||||
|
# with a short description of the software they come with.
|
||||||
|
white_list = {
|
||||||
|
"fuse.pc" => "MacFuse",
|
||||||
|
}
|
||||||
|
|
||||||
|
bad_pcs = unbrewed_pcs.reject {|d| white_list.key? File.basename(d) }
|
||||||
|
return if bad_pcs.empty?
|
||||||
|
|
||||||
|
puts <<-EOS.undent
|
||||||
|
Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
|
||||||
|
|
||||||
|
If you didn't put them there on purpose they could cause problems when
|
||||||
|
building Homebrew formulae, and may need to be deleted.
|
||||||
|
|
||||||
|
Unexpected .pc files:
|
||||||
|
EOS
|
||||||
|
puts *bad_pcs.collect { |f| " #{f}" }
|
||||||
|
puts
|
||||||
|
end
|
||||||
|
|
||||||
def check_for_x11
|
def check_for_x11
|
||||||
unless x11_installed?
|
unless x11_installed?
|
||||||
puts <<-EOS.undent
|
puts <<-EOS.undent
|
||||||
@ -628,6 +652,7 @@ module Homebrew extend self
|
|||||||
check_for_macgpg2
|
check_for_macgpg2
|
||||||
check_for_stray_dylibs
|
check_for_stray_dylibs
|
||||||
check_for_stray_static_libs
|
check_for_stray_static_libs
|
||||||
|
check_for_stray_pcs
|
||||||
check_gcc_versions
|
check_gcc_versions
|
||||||
check_for_other_package_managers
|
check_for_other_package_managers
|
||||||
check_for_x11
|
check_for_x11
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user