aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2012-02-26 16:33:44 -0800
committerAdam Vandenberg2012-02-26 16:33:44 -0800
commit87686d861051f25018288d6dab1333daef2e038f (patch)
tree3254c2ad21047960cbac6f3a76a928e95c7a63cb /Library
parent5d58792c5ef7b4b99ba3043c1da1961d9e87911d (diff)
downloadbrew-87686d861051f25018288d6dab1333daef2e038f.tar.bz2
audit: check sbin too
Apply the 'bin' audit to 'sbin' too, and also complain if subfolders are installed to either.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index e61967bb5..9a4801184 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -83,6 +83,7 @@ class FormulaInstaller
@show_summary_heading = true
else
audit_bin
+ audit_sbin
audit_lib
check_manpages
check_infopages
@@ -287,7 +288,7 @@ class FormulaInstaller
def audit_bin
return unless File.exist? f.bin
- non_exes = f.bin.children.select {|g| not File.executable? g}
+ non_exes = f.bin.children.select {|g| File.directory? g or not File.executable? g}
unless non_exes.empty?
opoo 'Non-executables were installed to "bin".'
@@ -298,6 +299,20 @@ class FormulaInstaller
end
end
+ def audit_sbin
+ return unless File.exist? f.sbin
+
+ non_exes = f.sbin.children.select {|g| File.directory? g or not File.executable? g}
+
+ unless non_exes.empty?
+ opoo 'Non-executables were installed to "sbin".'
+ puts "Installing non-executables to \"sbin\" is bad practice."
+ puts "The offending files are:"
+ puts non_exes
+ @show_summary_heading = true
+ end
+ end
+
def audit_lib
check_jars
check_non_libraries