Sha256: f74077b79fc31e9f003ffc80dc1764938bd8e08b464a1bb129107e77a5af94eb
Contents?: true
Size: 700 Bytes
Versions: 8
Compression:
Stored size: 700 Bytes
Contents
require 'dply/helper' module Dply class Rpm include Helper def libs_packages_map(libs) h = {} libs.each do |lib| list = whatprovides(lib) h[lib] = list if not list.empty? end return h end private def filtered?(pkg) @filtered ||= ["glibc", "libgcc", "libstdc++", "openssl", "ruby-alt", "jemalloc"] @filtered.include? pkg.strip end def whatprovides(lib) lib = "#{lib}()(64bit)" command = ["rpm", "--queryformat", "%{NAME} ", "-q", "--whatprovides", lib] output = cmd command, return_output: true, display: false list = output.strip.split.select {|pkg| not filtered? pkg } end end end
Version data entries
8 entries across 8 versions & 1 rubygems