audit: check sbin too
Apply the 'bin' audit to 'sbin' too, and also complain if subfolders are installed to either.
This commit is contained in:
parent
5d58792c5e
commit
87686d8610
@ -83,6 +83,7 @@ class FormulaInstaller
|
|||||||
@show_summary_heading = true
|
@show_summary_heading = true
|
||||||
else
|
else
|
||||||
audit_bin
|
audit_bin
|
||||||
|
audit_sbin
|
||||||
audit_lib
|
audit_lib
|
||||||
check_manpages
|
check_manpages
|
||||||
check_infopages
|
check_infopages
|
||||||
@ -287,7 +288,7 @@ class FormulaInstaller
|
|||||||
def audit_bin
|
def audit_bin
|
||||||
return unless File.exist? f.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?
|
unless non_exes.empty?
|
||||||
opoo 'Non-executables were installed to "bin".'
|
opoo 'Non-executables were installed to "bin".'
|
||||||
@ -298,6 +299,20 @@ class FormulaInstaller
|
|||||||
end
|
end
|
||||||
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
|
def audit_lib
|
||||||
check_jars
|
check_jars
|
||||||
check_non_libraries
|
check_non_libraries
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user