Package yum :: Module sqlitesack :: Class YumSqlitePackageSack
[hide private]
[frames] | no frames]

Class YumSqlitePackageSack

source code


Implementation of a PackageSack that uses sqlite cache instead of fully expanded metadata objects to provide information

Instance Methods [hide private]
 
__init__(self, packageClass)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_sql_MD(*args, **kwargs)
Exec SQL against an MD of the repo, return a cursor.
source code
 
_sql_MD_pkg_num(self, MD, repo)
Give a count of pkgIds in the given repo DB
source code
 
_clean_pkgobjlist(self)
If the pkgobjlist is dirty (possible pkgs on it which are excluded) then clean it, and return the clean list.
source code
 
__len__(self) source code
 
dropCachedData(self)
Do nothing, mainly for the testing code.
source code
 
close(*args, **kwargs) 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')
check to see if the indexes are built, if not do what failure demands either error out or build the indexes, default is to error out
source code
 
_delPackageRK(self, repo, pkgKey)
Exclude a package so that _pkgExcluded*() knows it's gone.
source code
 
delPackage(self, obj)
delete a pkgobject
source code
 
_delAllPackages(self, repo)
Exclude all packages from the repo.
source code
 
_excluded(self, repo, pkgId) source code
 
_pkgKeyExcluded(self, repo, pkgKey) source code
 
_pkgExcludedRKNEVRA(self, repo, pkgKey, n, e, v, r, a)
Main function to use for "can we use this package" question.
source code
 
_pkgExcludedRKT(self, repo, pkgKey, pkgtup)
Helper function to call _pkgExcludedRKNEVRA.
source code
 
_pkgExcludedRKD(self, repo, pkgKey, data)
Helper function to call _pkgExcludedRKNEVRA.
source code
 
_pkgExcluded(self, po)
Helper function to call _pkgExcludedRKNEVRA.
source code
 
addPackageExcluder(self, repoid, excluderid, excluder, *args)
Add an "excluder" for all packages in the repo/sack.
source code
 
_packageByKey(self, repo, pkgKey, exclude=True)
Lookup a pkg by it's pkgKey, if we don't have it load it
source code
 
_packageByKeyData(self, repo, pkgKey, data, exclude=True)
Like _packageByKey() but we already have the data for .pc()
source code
 
_pkgtupByKeyData(self, repo, pkgKey, data)
Like _packageByKeyData() but we don't create the package, we just return the pkgtup.
source code
 
_packagesByName(self, pkgname)
Load all pkgnames from cache, with a given name.
source code
 
addDict(self, repo, datatype, dataobj, callback=None) source code
 
searchAll(self, name, query_type='like') source code
 
_sql_pkgKey2po(self, repo, cur, pkgs=None, have_data=False)
Takes a cursor and maps the pkgKey rows into a list of packages.
source code
 
_skip_all(self)
Are we going to skip every package in all our repos?
source code
 
_search_primary_files(*args, **kwargs) source code
 
searchFiles(*args, **kwargs)
search primary if file will be in there, if not, search filelists, use globs, if possible
source code
 
searchPrimaryFields(*args, **kwargs)
search arbitrary fields from the primarydb for a string
source code
 
searchPrimaryFieldsMultipleStrings(*args, **kwargs)
search arbitrary fields from the primarydb for a multiple strings return packages, number of items it matched as a list of tuples
source code
 
returnObsoletes(*args, **kwargs)
returns a dict of obsoletes dict[obsoleting pkgtuple] = [list of obs]
source code
 
getPackageDetails(*args, **kwargs) source code
 
_getListofPackageDetails(*args, **kwargs) source code
 
_search_get_memoize(*args, **kwargs) source code
 
_search(*args, **kwargs) source code
 
getProvides(self, name, flags=None, version=(None, None, None))
return dict { packages -> list of matching provides }
source code
 
getRequires(self, name, flags=None, version=(None, None, None))
return dict { packages -> list of matching requires }
source code
 
searchNames(*args, **kwargs)
return a list of packages matching any of the given names.
source code
 
searchPrco(*args, **kwargs)
return list of packages matching name and prcotype
source code
 
searchProvides(self, name)
return list of packages providing name (any evr and flag)
source code
 
searchRequires(self, name)
return list of packages requiring name (any evr and flag)
source code
 
searchObsoletes(self, name)
return list of packages obsoleting name (any evr and flag)
source code
 
searchConflicts(self, name)
return list of packages conflicting with name (any evr and flag)
source code
 
db2class(self, db, nevra_only=False) source code
 
returnNewestByNameArch(*args, **kwargs)
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(*args, **kwargs)
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
 
matchPackageNames(*args, **kwargs)
take a list strings and match the packages in the sack against it this will match against: name name.arch name-ver-rel.arch name-ver name-ver-rel epoch:name-ver-rel.arch name-epoch:ver-rel.arch
source code
 
_setupPkgObjList(self, repoid=None, patterns=None, ignore_case=False)
Setup need_full and patterns for _yieldSQLDataList, also see if we can get away with just using searchNames().
source code
 
_yieldSQLDataList(*args, **kwargs)
Yields all the package data for the given params.
source code
 
_buildPkgObjList(self, repoid=None, patterns=None, ignore_case=False)
Builds a list of packages, only containing nevra information.
source code
 
returnPackages(self, repoid=None, patterns=None, ignore_case=False)
Returns a list of packages, only containing nevra information.
source code
 
simplePkgList(self, patterns=None, ignore_case=False)
Returns a list of pkg tuples (n, a, e, v, r), optionally from a single repoid.
source code
 
searchNevra(*args, **kwargs)
return list of pkgobjects matching the nevra requested
source code
 
excludeArchs(*args, **kwargs)
excludes incompatible arches - archlist is a list of compat arches
source code

Inherited from yumRepo.YumPackageSack: __del__, populate

Inherited from packageSack.PackageSack: addPackage, clearIndexes, printPackages, searchPackages, setCompatArchs

Inherited from packageSack.PackageSackBase: __cmp__, __iter__, contains, packagesByTuple, returnLeafNodes, searchPO, searchPkgTuple, simpleVersion

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, packageClass)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

_sql_MD(*args, **kwargs)

source code 

Exec SQL against an MD of the repo, return a cursor.

Decorators:
  • @catchSqliteException

__len__(self)
(Length operator)

source code 
Overrides: packageSack.PackageSackBase.__len__

dropCachedData(self)

source code 

Do nothing, mainly for the testing code.

Overrides: packageSack.PackageSack.dropCachedData
(inherited documentation)

close(*args, **kwargs)

source code 
Decorators:
  • @catchSqliteException
Overrides: yumRepo.YumPackageSack.close

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)

_checkIndexes(self, failure='error')

source code 

check to see if the indexes are built, if not do what failure demands either error out or build the indexes, default is to error out

Overrides: packageSack.PackageSack._checkIndexes
(inherited documentation)

_delPackageRK(self, repo, pkgKey)

source code 

Exclude a package so that _pkgExcluded*() knows it's gone. Note that this doesn't update self.exclude.

delPackage(self, obj)

source code 

delete a pkgobject

Overrides: packageSack.PackageSackBase.delPackage
(inherited documentation)

_pkgExcludedRKNEVRA(self, repo, pkgKey, n, e, v, r, a)

source code 

Main function to use for "can we use this package" question. . Tests repo against allowed repos. . Tests pkgKey against allowed packages. . Tests arch against allowed arches. . Tests addPackageExcluder() calls.

_pkgExcludedRKT(self, repo, pkgKey, pkgtup)

source code 

Helper function to call _pkgExcludedRKNEVRA. Takes a repo, pkgKey and a package tuple

_pkgExcludedRKD(self, repo, pkgKey, data)

source code 

Helper function to call _pkgExcludedRKNEVRA. Takes a repo, pkgKey and a dict of package data

_pkgExcluded(self, po)

source code 

Helper function to call _pkgExcludedRKNEVRA. Takes a package object.

addPackageExcluder(self, repoid, excluderid, excluder, *args)

source code 

Add an "excluder" for all packages in the repo/sack. Can basically do anything based on nevra, changes lots of exclude decisions from "preload package; test; delPackage" into "load excluder". Excluderid is used so the caller doesn't have to track "have I loaded the excluder for this repo.", it's probably only useful when repoid is None ... if it turns out utterly worthless then it's still not a huge wart.

Overrides: packageSack.PackageSackBase.addPackageExcluder

addDict(self, repo, datatype, dataobj, callback=None)

source code 
Overrides: yumRepo.YumPackageSack.addDict

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

source code 
Overrides: packageSack.PackageSackBase.searchAll

_search_primary_files(*args, **kwargs)

source code 
Decorators:
  • @catchSqliteException

searchFiles(*args, **kwargs)

source code 

search primary if file will be in there, if not, search filelists, use globs, if possible

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSackBase.searchFiles

searchPrimaryFields(*args, **kwargs)

source code 

search arbitrary fields from the primarydb for a string

Decorators:
  • @catchSqliteException

searchPrimaryFieldsMultipleStrings(*args, **kwargs)

source code 

search arbitrary fields from the primarydb for a multiple strings return packages, number of items it matched as a list of tuples

Decorators:
  • @catchSqliteException

returnObsoletes(*args, **kwargs)

source code 

returns a dict of obsoletes dict[obsoleting pkgtuple] = [list of obs]

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSackBase.returnObsoletes
(inherited documentation)

getPackageDetails(*args, **kwargs)

source code 
Decorators:
  • @catchSqliteException

_getListofPackageDetails(*args, **kwargs)

source code 
Decorators:
  • @catchSqliteException

_search_get_memoize(*args, **kwargs)

source code 
Decorators:
  • @catchSqliteException

_search(*args, **kwargs)

source code 
Decorators:
  • @catchSqliteException

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

source code 

return dict { packages -> list of matching provides }

Overrides: packageSack.PackageSackBase.getProvides
(inherited documentation)

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

source code 

return dict { packages -> list of matching requires }

Overrides: packageSack.PackageSackBase.getRequires
(inherited documentation)

searchNames(*args, **kwargs)

source code 

return a list of packages matching any of the given names. This is only a match on package name, nothing else

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSackBase.searchNames

searchPrco(*args, **kwargs)

source code 

return list of packages matching name and prcotype

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSack.searchPrco

searchProvides(self, name)

source code 

return list of packages providing name (any evr and flag)

Overrides: packageSack.PackageSackBase.searchProvides

searchRequires(self, name)

source code 

return list of packages requiring name (any evr and flag)

Overrides: packageSack.PackageSackBase.searchRequires

searchObsoletes(self, name)

source code 

return list of packages obsoleting name (any evr and flag)

Overrides: packageSack.PackageSackBase.searchObsoletes

searchConflicts(self, name)

source code 

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

Overrides: packageSack.PackageSackBase.searchConflicts

returnNewestByNameArch(*args, **kwargs)

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

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSackBase.returnNewestByNameArch
(inherited documentation)

returnNewestByName(*args, **kwargs)

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.

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSackBase.returnNewestByName

matchPackageNames(*args, **kwargs)

source code 

take a list strings and match the packages in the sack against it this will match against: name name.arch name-ver-rel.arch name-ver name-ver-rel epoch:name-ver-rel.arch name-epoch:ver-rel.arch

return [exact matches], [glob matches], [unmatch search terms]

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSackBase.matchPackageNames
(inherited documentation)

_yieldSQLDataList(*args, **kwargs)

source code 

Yields all the package data for the given params. Excludes are done at this stage.

Decorators:
  • @catchSqliteException

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

source code 

Builds a list of packages, only containing nevra information. Excludes are done at this stage.

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

source code 

Returns a list of packages, only containing nevra information. The packages are processed for excludes. Note that the packages are always filtered to those matching the patterns/case.

Overrides: packageSack.PackageSackBase.returnPackages

simplePkgList(self, patterns=None, ignore_case=False)

source code 

Returns a list of pkg tuples (n, a, e, v, r), optionally from a single repoid. Note that the packages are always filtered to those matching the patterns/case.

Overrides: packageSack.PackageSackBase.simplePkgList

searchNevra(*args, **kwargs)

source code 

return list of pkgobjects matching the nevra requested

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSackBase.searchNevra

excludeArchs(*args, **kwargs)

source code 

excludes incompatible arches - archlist is a list of compat arches

Decorators:
  • @catchSqliteException
Overrides: packageSack.PackageSackBase.excludeArchs