aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2011-05-09 17:23:35 -0700
committerAdam Vandenberg2011-05-09 17:23:35 -0700
commitf81d5f88c804652d8bd1b233d3929dd57f46ca68 (patch)
tree28a019a1091cf70fb3f76144db4597c0f7480b20
parent4b94598702d7c04381c73e61c53ad3b4f38ca55f (diff)
downloadhomebrew-f81d5f88c804652d8bd1b233d3929dd57f46ca68.tar.bz2
brew doctor: add check for stray .pc files
-rw-r--r--Library/Homebrew/cmd/doctor.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 61a700456..4017f73ee 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -89,6 +89,30 @@ def check_for_stray_static_libs
puts
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
unless x11_installed?
puts <<-EOS.undent
@@ -628,6 +652,7 @@ module Homebrew extend self
check_for_macgpg2
check_for_stray_dylibs
check_for_stray_static_libs
+ check_for_stray_pcs
check_gcc_versions
check_for_other_package_managers
check_for_x11