aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2014-09-24 15:03:05 -0700
committerMike McQuaid2014-09-24 15:03:05 -0700
commit338a451a47c884eb9ca96d7b0023417a1eaa4d3d (patch)
tree5bdbe68f4aa71907313051e362362fc438b5084b
parente81b82cc725ede00c1292a50a076bb8a652ccecd (diff)
downloadhomebrew-338a451a47c884eb9ca96d7b0023417a1eaa4d3d.tar.bz2
Revert "Simplify unbrewed file whitelists"
This reverts commit 2885a92612173f480303b03da1da739eb68550d7.
-rw-r--r--Library/Homebrew/cmd/doctor.rb47
1 files changed, 24 insertions, 23 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 260187040..192302921 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -108,8 +108,9 @@ def __check_stray_files(dir, pattern, white_list, message)
Dir[pattern].select { |f| File.file?(f) && !File.symlink?(f) }
}
+ keys = white_list.keys
bad = files.reject { |file|
- white_list.any? { |pat| File.fnmatch?(pat, file) }
+ keys.any? { |pat| File.fnmatch?(pat, file) }
}
bad.map! { |file| File.join(dir, file) }
@@ -120,12 +121,12 @@ end
def check_for_stray_dylibs
# Dylibs which are generally OK should be added to this list,
# with a short description of the software they come with.
- white_list = [
- "libfuse.2.dylib", # MacFuse
- "libfuse_ino64.2.dylib", # MacFuse
- "libosxfuse_i32.2.dylib", # OSXFuse
- "libosxfuse_i64.2.dylib", # OSXFuse
- ]
+ white_list = {
+ "libfuse.2.dylib" => "MacFuse",
+ "libfuse_ino64.2.dylib" => "MacFuse",
+ "libosxfuse_i32.2.dylib" => "OSXFuse",
+ "libosxfuse_i64.2.dylib" => "OSXFuse",
+ }
__check_stray_files "/usr/local/lib", "*.dylib", white_list, <<-EOS.undent
Unbrewed dylibs were found in /usr/local/lib.
@@ -139,10 +140,10 @@ end
def check_for_stray_static_libs
# Static libs which are generally OK should be added to this list,
# with a short description of the software they come with.
- white_list = [
- "libsecurity_agent_client.a", # OS X 10.8.2 Supplemental Update
- "libsecurity_agent_server.a", # OS X 10.8.2 Supplemental Update
- ]
+ white_list = {
+ "libsecurity_agent_client.a" => "OS X 10.8.2 Supplemental Update",
+ "libsecurity_agent_server.a" => "OS X 10.8.2 Supplemental Update"
+ }
__check_stray_files "/usr/local/lib", "*.a", white_list, <<-EOS.undent
Unbrewed static libraries were found in /usr/local/lib.
@@ -156,9 +157,9 @@ end
def check_for_stray_pcs
# 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 = [
- "osxfuse.pc", # OSXFuse
- ]
+ white_list = {
+ "osxfuse.pc" => "OSXFuse",
+ }
__check_stray_files "/usr/local/lib/pkgconfig", "*.pc", white_list, <<-EOS.undent
Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
@@ -170,12 +171,12 @@ def check_for_stray_pcs
end
def check_for_stray_las
- white_list = [
- "libfuse.la", # MacFuse
- "libfuse_ino64.la", # MacFuse
- "libosxfuse_i32.la", # OSXFuse
- "libosxfuse_i64.la", # OSXFuse
- ]
+ white_list = {
+ "libfuse.la" => "MacFuse",
+ "libfuse_ino64.la" => "MacFuse",
+ "libosxfuse_i32.la" => "OSXFuse",
+ "libosxfuse_i64.la" => "OSXFuse",
+ }
__check_stray_files "/usr/local/lib", "*.la", white_list, <<-EOS.undent
Unbrewed .la files were found in /usr/local/lib.
@@ -187,9 +188,9 @@ def check_for_stray_las
end
def check_for_stray_headers
- white_list = [
- "osxfuse/*", # OSXFuse
- ]
+ white_list = {
+ "osxfuse/*" => "OSXFuse",
+ }
__check_stray_files "/usr/local/include", "**/*.h", white_list, <<-EOS.undent
Unbrewed header files were found in /usr/local/include.