Skip to content

Instantly share code, notes, and snippets.

@MOZGIII
Created June 9, 2013 13:06
Show Gist options
  • Save MOZGIII/5743445 to your computer and use it in GitHub Desktop.
Save MOZGIII/5743445 to your computer and use it in GitHub Desktop.
Filter Qt plugins by dependencies
#!/usr/bin/env ruby
allowed_libs = %w{
libQtCore.so.4
libQtNetwork.so.4
libQtWebKit.so.4
libQtGui.so.4
}
puts "Allowed libs: "
allowed_libs.each do |lib|
puts " #{lib}"
end
puts
Dir["plugins/*/*.so"].each do |file|
list = `ldd "#{file}" | grep Qt`.split("\n").map{|e| e.scan(/(lib[^\s]*\.so[^\s]+)/)[0][0] }
list -= allowed_libs
unless list.empty?
# puts "="*80
puts file
puts list.map{|e| " " + e}
puts
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment