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.
This commit is contained in:
parent
e08ec21abe
commit
81bf8a168a
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user