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