Sha256: 277d9fa6070591b581f521fed368e71d4d027a1ee0ff4eb5349acd3b21c87636

Contents?: true

Size: 699 Bytes

Versions: 4

Compression:

Stored size: 699 Bytes

Contents

require 'dply/helper'

module Dply
  class Rpm
    include Helper

    def libs_to_packages(libs)
      packages = Set.new
      libs.each do |l|
        lib = "#{l}()(64bit)"
        command = %(rpm --queryformat "%{NAME} " -q --whatprovides "#{lib}")
        logger.debug command
        output = `#{command}`
        error "running command #{command}" if not $?.exitstatus == 0
        list = output.strip.split.select {|pkg| not filtered? pkg }
        packages << list if not list.empty?
      end
      return packages
    end

    def filtered?(pkg)
      @filtered ||= ["glibc", "libgcc", "libstdc++", "openssl", "ruby-alt", "jemalloc"]
      @filtered.include? pkg.strip
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dply-0.1.6 lib/dply/rpm.rb
dply-0.1.5 lib/dply/rpm.rb
dply-0.1.4 lib/dply/rpm.rb
dply-0.1.2 lib/dply/rpm.rb