aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2013-11-10 12:51:24 -0800
committerAdam Vandenberg2013-11-12 07:10:13 -0800
commitb4ba9dc2f599ff173e85adbdda94a0c42e423bf6 (patch)
tree67deb66311603375ffb8525e743104d59ecb1970 /Library
parentcbaef82d6d2e8e58f1420d4b1620e749c4872ba5 (diff)
downloadhomebrew-b4ba9dc2f599ff173e85adbdda94a0c42e423bf6.tar.bz2
audit generic binary names
Binaries with names like 'run' or 'service' are likely to conflict. Warn about these and suggest a libexec-style install instead.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/audit.rb2
-rw-r--r--Library/Homebrew/formula_cellar_checks.rb17
-rw-r--r--Library/Homebrew/formula_installer.rb2
3 files changed, 21 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 10b37e57a..80c2e45e5 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -562,7 +562,9 @@ class FormulaAuditor
audit_check_output(check_jars)
audit_check_output(check_non_libraries)
audit_check_output(check_non_executables(f.bin))
+ audit_check_output(check_generic_executables(f.bin))
audit_check_output(check_non_executables(f.sbin))
+ audit_check_output(check_generic_executables(f.sbin))
end
def audit
diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb
index f123a85cc..b1b52b28a 100644
--- a/Library/Homebrew/formula_cellar_checks.rb
+++ b/Library/Homebrew/formula_cellar_checks.rb
@@ -89,4 +89,21 @@ module FormulaCellarChecks
EOS
]
end
+
+ def check_generic_executables bin
+ return unless bin.directory?
+ generics = bin.children.select { |g| g.to_s =~ /\/(run|service)$/}
+ return if generics.empty?
+
+ ["Generic binaries were installed to \"#{bin}\".",
+ <<-EOS.undent
+ Binaries with generic names are likely to conflict with other software,
+ and suggest that this software should be installed to "libexec" and
+ then symlinked as needed.
+
+ The offending files are:
+ #{generics * "\n "}
+ EOS
+ ]
+ end
end
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 5870ceeff..1f2f99875 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -499,11 +499,13 @@ class FormulaInstaller
def audit_bin
print_check_output(check_PATH(f.bin)) unless f.keg_only?
print_check_output(check_non_executables(f.bin))
+ print_check_output(check_generic_executables(f.bin))
end
def audit_sbin
print_check_output(check_PATH(f.sbin)) unless f.keg_only?
print_check_output(check_non_executables(f.sbin))
+ print_check_output(check_generic_executables(f.sbin))
end
def audit_lib