Package yum :: Module rpmsack :: Class RPMDBPackageSack
[hide private]
[frames] | no frames]

Class RPMDBPackageSack

source code


Represent rpmdb as a packagesack

Instance Methods [hide private]
 
__init__(self, root='/', releasever=None, cachedir=None, persistdir='/var/lib/yum')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_get_pkglist(self)
Getter for the pkglist property.
source code
 
dropCachedData(self) source code
 
setCacheDir(self, cachedir)
Sets the internal cachedir value for the rpmdb, to be the "installed" directory from this parent.
source code
 
readOnlyTS(self) source code
 
buildIndexes(self)
builds the useful indexes for searching/querying the packageSack This should be called after all the necessary packages have been added/deleted
source code
 
_checkIndexes(self, failure='error') source code
 
delPackage(self, obj)
delete a pkgobject
source code
 
searchAll(self, name, query_type='like') source code
 
searchFiles(self, name)
search the filelists in the rpms for anything matching name
source code
 
searchPrco(self, name, prcotype) source code
 
searchProvides(self, name)
return list of package providing the name (any evr and flag)
source code
 
searchRequires(self, name)
return list of package requiring the name (any evr and flag)
source code
 
searchObsoletes(self, name)
return list of package obsoleting the name (any evr and flag)
source code
 
searchConflicts(self, name)
return list of package conflicting with the name (any evr and flag)
source code
 
simplePkgList(self)
returns a list of pkg tuples (n, a, e, v, r)
source code
 
installed(self, 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
source code
 
returnNewestByNameArch(self, naTup=None, patterns=None)
return list of newest packages based on name, arch matching this means(in name.arch form): foo.i386 and foo.noarch are not compared to each other for highest version only foo.i386 and foo.i386 will be compared
source code
 
returnNewestByName(self, name=None)
return list of newest packages based on name matching this means(in name.arch form): foo.i386 and foo.noarch will be compared to each other for highest version.
source code
 
returnPackages(self, repoid=None, patterns=None, ignore_case=False)
Returns a list of packages.
source code
 
_uncached_returnConflictPackages(self) source code
 
_write_conflicts_new(self, pkgs, rpmdbv) source code
 
_write_conflicts(self, pkgs) source code
 
_read_conflicts(self) source code
 
transactionCacheConflictPackages(self, pkgs) source code
 
returnConflictPackages(self)
Return a list of packages that have conflicts.
source code
 
transactionResultVersion(self, rpmdbv)
We are going to do a transaction, and the parameter will be the rpmdb version when we finish.
source code
 
transactionReset(self)
We are going to reset the transaction, because the data we've added already might now be invalid (Eg.
source code
 
returnGPGPubkeyPackages(self)
Return packages of the gpg-pubkeys ...
source code
 
_read_file_requires(self) source code
 
fileRequiresData(self)
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.
source code
 
transactionCacheFileRequires(self, installedFileRequires, installedUnresolvedFileRequires, installedFileProvides, problems) source code
 
_write_file_requires(self, rpmdbversion, data) source code
 
preloadPackageChecksums(self)
As simpleVersion() et.
source code
 
transactionCachePackageChecksums(self, pkg_checksum_tups) source code
 
_write_package_checksums(self, rpmdbversion, data) source code
 
_get_cached_simpleVersion_main(self)
Return the cached string of the main rpmdbv.
source code
 
_put_cached_simpleVersion_main(self, rpmdbv) source code
 
simpleVersion(self, main_only=False, groups={})
Return a simple version for all installed packages.
source code
 
searchPrimaryFieldsMultipleStrings(self, fields, searchstrings, lowered=False) source code
 
searchNames(self, names=[]) source code
 
searchNevra(self, name=None, epoch=None, ver=None, rel=None, arch=None)
return list of pkgobjects matching the nevra requested
source code
 
excludeArchs(self, archlist)
exclude incompatible arches.
source code
 
returnLeafNodes(self, repoid=None)
returns a list of package objects that are not required by any other package in this repository
source code
 
_all_packages(self)
Generator that yield (header, index) for all packages
source code
 
_header_from_index(self, idx)
returns a package header having been given an index
source code
 
_search(self, name=None, epoch=None, ver=None, rel=None, arch=None)
List of matching packages, to zero or more of NEVRA.
source code
 
_makePackageObject(self, hdr, index) source code
 
_hdr2pkgTuple(self, hdr) source code
 
getPkgList(self) source code
 
getHdrList(self) source code
 
getNameArchPkgList(self) source code
 
getNamePkgList(self) source code
 
returnTupleByKeyword(self, name=None, arch=None, epoch=None, ver=None, rel=None) source code
 
returnHeaderByTuple(self, pkgtuple) source code
 
returnIndexByTuple(self, pkgtuple)
returns a list of header indexes based on the pkgtuple provided
source code
 
addDB(self, ts) source code
 
getProvides(self, 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
source code
 
whatProvides(self, name, flags, version) source code
 
getRequires(self, 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
source code
 
whatRequires(self, name, flags, version) source code
 
return_running_packages(self)
returns a list of yum installed package objects which own a file that are currently running or in use.
source code
 
check_dependencies(self, pkgs=None)
Checks for any missing dependencies.
source code
 
_iter_two_pkgs(self, ignore_provides) source code
 
check_duplicates(self, 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).
source code

Inherited from packageSack.PackageSackBase: __cmp__, __iter__, __len__, addPackage, addPackageExcluder, contains, matchPackageNames, packagesByTuple, populate, printPackages, returnObsoletes, searchPO, searchPackages, searchPkgTuple, setCompatArchs

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
_compile_patterns(patterns, ignore_case=False) source code
 
_match_repattern(repatterns, hdr, ignore_case) source code
 
_find_search_fields(fields, searchstrings, hdr) source code
 
_genDeptup(name, flags, version)
Given random stuff, generate a usable dep tuple.
source code
Class Variables [hide private]
  DEP_TABLE = {'conflicts': (1054, 1055, 1053), 'obsoletes': (10...
  __cache_rpmdb__ = True
Properties [hide private]
  pkglist
Getter for the pkglist property.

Inherited from object: __class__

Method Details [hide private]

__init__(self, root='/', releasever=None, cachedir=None, persistdir='/var/lib/yum')
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

_get_pkglist(self)

source code 

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

buildIndexes(self)

source code 

builds the useful indexes for searching/querying the packageSack This should be called after all the necessary packages have been added/deleted

Overrides: packageSack.PackageSackBase.buildIndexes
(inherited documentation)

delPackage(self, obj)

source code 

delete a pkgobject

Overrides: packageSack.PackageSackBase.delPackage
(inherited documentation)

searchAll(self, name, query_type='like')

source code 
Overrides: packageSack.PackageSackBase.searchAll

searchFiles(self, name)

source code 

search the filelists in the rpms for anything matching name

Overrides: packageSack.PackageSackBase.searchFiles

searchProvides(self, name)

source code 

return list of package providing the name (any evr and flag)

Overrides: packageSack.PackageSackBase.searchProvides
(inherited documentation)

searchRequires(self, name)

source code 

return list of package requiring the name (any evr and flag)

Overrides: packageSack.PackageSackBase.searchRequires
(inherited documentation)

searchObsoletes(self, name)

source code 

return list of package obsoleting the name (any evr and flag)

Overrides: packageSack.PackageSackBase.searchObsoletes
(inherited documentation)

searchConflicts(self, name)

source code 

return list of package conflicting with the name (any evr and flag)

Overrides: packageSack.PackageSackBase.searchConflicts
(inherited documentation)

simplePkgList(self)

source code 

returns a list of pkg tuples (n, a, e, v, r)

Overrides: packageSack.PackageSackBase.simplePkgList
(inherited documentation)

returnNewestByNameArch(self, naTup=None, patterns=None)

source code 

return list of newest packages based on name, arch matching this means(in name.arch form): foo.i386 and foo.noarch are not compared to each other for highest version only foo.i386 and foo.i386 will be compared

Overrides: packageSack.PackageSackBase.returnNewestByNameArch
(inherited documentation)

returnNewestByName(self, name=None)

source code 

return list of newest packages based on name matching this means(in name.arch form): foo.i386 and foo.noarch will be compared to each other for highest version. Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64 The last _two_ pkgs will be returned, not just one of them.

Overrides: packageSack.PackageSackBase.returnNewestByName
(inherited documentation)

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

source code 

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.

Overrides: packageSack.PackageSackBase.returnPackages

transactionResultVersion(self, rpmdbv)

source code 

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.

transactionReset(self)

source code 

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).

returnGPGPubkeyPackages(self)

source code 

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

preloadPackageChecksums(self)

source code 

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.

simpleVersion(self, main_only=False, groups={})

source code 

Return a simple version for all installed packages.

Overrides: packageSack.PackageSackBase.simpleVersion

searchNames(self, names=[])

source code 
Overrides: packageSack.PackageSackBase.searchNames

searchNevra(self, name=None, epoch=None, ver=None, rel=None, arch=None)

source code 

return list of pkgobjects matching the nevra requested

Overrides: packageSack.PackageSackBase.searchNevra
(inherited documentation)

excludeArchs(self, archlist)

source code 

exclude incompatible arches. archlist is a list of compatible arches

Overrides: packageSack.PackageSackBase.excludeArchs
(inherited documentation)

returnLeafNodes(self, repoid=None)

source code 

returns a list of package objects that are not required by any other package in this repository

Overrides: packageSack.PackageSackBase.returnLeafNodes
(inherited documentation)

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

source code 

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

Overrides: packageSack.PackageSackBase.getProvides

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

source code 

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

Overrides: packageSack.PackageSackBase.getRequires

Class Variable Details [hide private]

DEP_TABLE

Value:
{'conflicts': (1054, 1055, 1053),
 'obsoletes': (1090, 1115, 1114),
 'provides': (1047, 1113, 1112),
 'requires': (1049, 1050, 1048)}

Property Details [hide private]

pkglist

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

Get Method:
_get_pkglist(self) - Getter for the pkglist property.