Skip to content
Snippets Groups Projects
Commit 27fb8bef authored by Shaun Jackman's avatar Shaun Jackman
Browse files

check_non_libraries: *.so.* is valid on Linux

parent 2c68176a
No related branches found
No related tags found
No related merge requests found
require "extend/os/mac/formula_cellar_checks" if OS.mac?
if OS.mac?
require "extend/os/mac/formula_cellar_checks"
elsif OS.linux?
require "extend/os/linux/formula_cellar_checks"
end
module FormulaCellarChecks
def valid_library_extension?(filename)
generic_valid_library_extension?(filename) || filename.basename.to_s.include?(".so.")
end
end
......@@ -56,14 +56,19 @@ module FormulaCellarChecks
EOS
end
VALID_LIBRARY_EXTENSIONS = %w[.a .dylib .framework .jnilib .la .o .so .jar .prl .pm .sh].freeze
def valid_library_extension?(filename)
VALID_LIBRARY_EXTENSIONS.include? filename.extname
end
alias generic_valid_library_extension? valid_library_extension?
def check_non_libraries
return unless formula.lib.directory?
valid_extensions = %w[.a .dylib .framework .jnilib .la .o .so
.jar .prl .pm .sh]
non_libraries = formula.lib.children.reject do |g|
next true if g.directory?
valid_extensions.include? g.extname
valid_library_extension? g
end
return if non_libraries.empty?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment