Sha256: c9f66d25e6e1b17a12eb7a2829a3db4ea0e996423e0f9e796f4a4656bd487193

Contents?: true

Size: 982 Bytes

Versions: 63

Compression:

Stored size: 982 Bytes

Contents

require 'binary_struct'
require 'util/miq-hash_struct'
require 'db/MiqSqlite/MiqSqlite3'

class MiqConaryPackages
  def initialize(fs, dbFile)
    @pkgDb = MiqSqlite3DB::MiqSqlite3.new(dbFile, fs)

    tVersions  = @pkgDb.getTable("Versions")
    tInstances = @pkgDb.getTable("Instances")

    @versions = {}
    tVersions.each_row do |row|
      id            = row['versionId']
      @versions[id] = row['version']
    end

    @troves = {}
    tInstances.each_row do |row|
      troveName = row['troveName']
      versionId = row['versionId']
      @troves[troveName] = versionId if @versions.key?(versionId) && !troveName.include?(":") && row['isPresent']
    end
  end

  def each
    @troves.keys.sort.each do |t|
      versionId = @troves[t]
      pkg  = MiqHashStruct.new
      pkg.name      = t
      pkg.version   = @versions[versionId]
      pkg.installed = true

      yield pkg
    end
  end # def each

  def close
    @pkgDb.close
  end
end # class MiqConaryPackages

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
manageiq-smartstate-0.8.1 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.8.0 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.7.0 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.6.2 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.5.10 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.3.10 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.6.1 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.3.9 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.6.0 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.5.9 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.5.8 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.3.8 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.5.7 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.3.7 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.5.6 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.3.6 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.5.5 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.5.4 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.3.5 lib/metadata/linux/MiqConaryPackages.rb
manageiq-smartstate-0.5.3 lib/metadata/linux/MiqConaryPackages.rb