yum.packageSack

Classes for manipulating and querying groups of packages.

PackageSackVersion

class yum.packageSack.PackageSackVersion

PackageSackBase

class yum.packageSack.PackageSackBase

Bases: object

Base class that provides the interface for PackageSacks.

addPackage(obj)

add a pkgobject to the packageSack

addPackageExcluder(repoid, excluderid, excluder, *args)

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.

buildIndexes()

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

contains(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

delPackage(obj)

delete a pkgobject

excludeArchs(archlist)

exclude incompatible arches. archlist is a list of compatible arches

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

return dict { packages -> list of matching provides }

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

return dict { packages -> list of matching requires }

have_fastReturnFileEntries()

Is calling pkg.returnFileEntries(primary_only=True) faster than using searchFiles().

matchPackageNames(pkgspecs)

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]

packagesByTuple(pkgtup)

return a list of package objects by (n,a,e,v,r) tuple

returnLeafNodes(repoid=None)

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

returnNewestByName(name=None, patterns=None, ignore_case=False)

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.

returnNewestByNameArch(naTup=None, patterns=None, ignore_case=False)

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

returnObsoletes(newest=False)

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

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

return list of all packages

searchConflicts(name)

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

searchFiles(name)

return list of packages by filename

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

return list of pkgobjects matching the nevra requested

searchObsoletes(name)

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

searchPO(po)

return list of package objects matching the name, epoch, ver, rel, arch of the package object passed in

searchPkgTuple(pkgtup)

return list of pkgobject matching the (n,a,e,v,r) tuple

searchProvides(name)

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

searchRequires(name)

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

simplePkgList(patterns=None, ignore_case=False)

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

simpleVersion(main_only=False, groups={})

Return a simple version for all available packages.

MetaSack

class yum.packageSack.MetaSack

Bases: yum.packageSack.PackageSackBase

Represents the aggregate of multiple package sacks, such that they can all be treated as one unified sack.

addPackage(obj)

Add a pkgobject to the packageSack. This is a meaningless operation for the MetaSack.

addPackageExcluder(repoid, excluderid, excluder, *args)

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.

addSack(repoid, sack)

Adds a repository’s packageSack to this MetaSack.

buildIndexes()

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

delPackage(obj)

Delete a pkgobject if it exists in every sub-sack.

excludeArchs(archlist)

exclude incompatible arches. archlist is a list of compatible arches

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

return dict { packages -> list of matching provides }

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

return dict { packages -> list of matching requires }

packagesByTuple(pkgtup)

return a list of package objects by (n,a,e,v,r) tuple

returnNewestByName(name=None, patterns=None, ignore_case=False)

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.

returnNewestByNameArch(naTup=None, patterns=None, ignore_case=False)

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

returnObsoletes(newest=False)

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

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. An optional repoid allows you to easily get data for a specific repo.

searchConflicts(name)

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

searchFiles(name)

return list of packages by filename

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

return list of pkgobjects matching the nevra requested

searchObsoletes(name)

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

searchProvides(name)

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

searchRequires(name)

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

simplePkgList(patterns=None, ignore_case=False)

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

PackageSack

class yum.packageSack.PackageSack

Bases: yum.packageSack.PackageSackBase

represents sets (sacks) of Package Objects

addPackage(obj)

add a pkgobject to the packageSack

buildIndexes()

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

delPackage(obj)

delete a pkgobject

dropCachedData()

Do nothing, mainly for the testing code.

excludeArchs(archlist)

exclude incompatible arches. archlist is a list of compatible arches

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

return dict { packages -> list of matching provides }

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

return dict { packages -> list of matching requires }

have_fastReturnFileEntries()

Is calling pkg.returnFileEntries(primary_only=True) faster than using searchFiles().

returnNewestByName(name=None, patterns=None, ignore_case=False)

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.

returnNewestByNameArch(naTup=None, patterns=None, ignore_case=False)

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

returnObsoletes(newest=False)

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

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

return list of all packages, takes optional repoid

searchConflicts(name)

return list of package conflicting with item requested

searchFiles(name)

Return list of packages by filename.

searchNames(names=[], return_pkgtups=False)

return list of pkgobjects matching the names requested

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

return list of pkgobjects matching the nevra requested

searchObsoletes(name)

return list of package obsoleting the item requested

searchProvides(name)

return list of package providing the item requested

searchRequires(name)

return list of package requiring the item requested

simplePkgList(patterns=None, ignore_case=False)

returns a list of pkg tuples (n, a, e, v, r) optionally from a single repoid

yum.packageSack.packagesNewestByName(pkgs)

Does the same as PackageSack.returnNewestByName(). Note that given: foo-1.i386; foo-2.i386 and foo-3.x86_64

yum.packageSack.packagesNewestByNameArch(pkgs)

Does the same as PackageSack.returnNewestByNameArch() The last _two_ pkgs will be returned, not just one of them.

ListPackageSack

class yum.packageSack.ListPackageSack(Objlist=None)

Bases: yum.packageSack.PackageSack

Derived class from PackageSack to build new Sack from list of pkgObjects - like one returned from self.returnNewestByNameArch() or self.returnNewestByName()

Table Of Contents

Previous topic

yum.misc

Next topic

yum.packages

This Page