yum.rpmsack

RPMInstalledPackage

class yum.rpmsack.RPMInstalledPackage(rpmhdr, index, rpmdb)

Bases: yum.packages.YumInstalledPackage

requiring_packages()

return list of installed pkgs requiring this package

RPMDBProblem

class yum.rpmsack.RPMDBProblem(pkg, problem, **kwargs)

Represents a problem in the rpmdb, from the check_*() functions.

RPMDBProblemDependency

class yum.rpmsack.RPMDBProblemDependency(pkg, problem, **kwargs)

Bases: yum.rpmsack.RPMDBProblem

RPMDBProblemDuplicate

class yum.rpmsack.RPMDBProblemDuplicate(pkg, **kwargs)

Bases: yum.rpmsack.RPMDBProblem

RPMDBProblemObsoleted

class yum.rpmsack.RPMDBProblemObsoleted(pkg, **kwargs)

Bases: yum.rpmsack.RPMDBProblem

RPMDBProblemProvides

class yum.rpmsack.RPMDBProblemProvides(pkg, **kwargs)

Bases: yum.rpmsack.RPMDBProblem

RPMDBPackageSack

class yum.rpmsack.RPMDBPackageSack(root='/', releasever=None, cachedir=None, persistdir='/var/lib/yum')

Bases: yum.packageSack.PackageSackBase

Represent rpmdb as a packagesack

check_dependencies(pkgs=None)

Checks for any missing dependencies.

check_duplicates(ignore_provides=[])

Checks for any “duplicate packages” (those with multiple versions installed), we ignore any packages with a provide in the passed provide list (this is how installonlyworks, so we do the same).

check_obsoleted()

Checks for any packages which are obsoleted by other packages.

check_provides()

For each package, check that a provides search for it’s name (and everything it provides) finds it.

dropCachedData()

Drop all cached data, this is a big perf. hit if we need to load the data back in again. Also note that if we ever call this while a transaction is ongoing we’ll have multiple copies of packages which is _bad_.

dropCachedDataPostTransaction(txmbrs)

Drop cached data that is assocciated with the given transaction, this tries to keep as much data as possible and even does a “preload” on the checksums. This should be called once, when a transaction is complete.

fileRequiresData()

Get a cached copy of the fileRequiresData for depsolving/checkFileRequires, note the giant comment in that function about how we don’t keep this perfect for the providers of the requires.

getProvides(name, flags=None, version=(None, None, None))

searches the rpmdb for what provides the arguments returns a list of pkg objects of providing packages, possibly empty

getRequires(name, flags=None, version=(None, None, None))

searches the rpmdb for what provides the arguments returns a list of pkgtuples of providing packages, possibly empty

installed(name=None, arch=None, epoch=None, ver=None, rel=None, po=None)

return if there are any packages in the sack that match the given NAEVR or the NAEVR of the given po

pkglist

Getter for the pkglist property. Returns a list of package tuples.

preloadPackageChecksums(load_packages=True)

As simpleVersion() et. al. requires it, we “cache” this yumdb data as part of our rpmdb cache. We cache it with rpmdb data, even though someone _could_ use yumdb to alter it without changing the rpmdb ... don’t do that. NOTE: This is also used as a cache of pkgtups in the rpmdb.

returnConflictPackages()

Return a list of packages that have conflicts.

returnGPGPubkeyPackages()

Return packages of the gpg-pubkeys ... hacky.

returnIndexByTuple(pkgtuple)

returns a list of header indexes based on the pkgtuple provided

returnPackages(repoid=None, patterns=None, ignore_case=False)

Returns a list of packages. Note that the packages are always filtered to those matching the patterns/case. repoid is ignored, and is just here for compatibility with non-rpmdb sacks.

return_running_packages()

returns a list of yum installed package objects which own a file that are currently running or in use.

searchFiles(name)

search the filelists in the rpms for anything matching name

setCacheDir(cachedir)

Sets the internal cachedir value for the rpmdb, to be the “rpmdb-indexes” directory in the persisent yum storage.

simpleVersion(main_only=False, groups={})

Return a simple version for all installed packages.

transactionReset()

We are going to reset the transaction, because the data we’ve added already might now be invalid (Eg. skip-broken, or splitting a transaction).

transactionResultVersion(rpmdbv)

We are going to do a transaction, and the parameter will be the rpmdb version when we finish. The idea being we can update all our rpmdb caches for that rpmdb version.

RPMDBAdditionalData

class yum.rpmsack.RPMDBAdditionalData(db_path='/var/lib/yum/yumdb', version_path=None)

Bases: object

class for access to the additional data not able to be stored in the rpmdb

get_package(po=None, pkgtup=None, pkgid=None)

Return an RPMDBAdditionalDataPackage Object for this package

sync_with_rpmdb(rpmdbobj)

populate out the dirs and remove all the items no longer in the rpmd and/or populate various bits to the currently installed version

RPMDBAdditionalDataPackage

class yum.rpmsack.RPMDBAdditionalDataPackage(conf, pkgdir, yumdb_cache=None)

Bases: object

get(attr, default=None)

retrieve an add’l data obj

yum.rpmsack.main()