This is a primary structure and base class. It houses the objects and
methods needed to perform most things in yum. It is almost an abstract
class in that you will need to add your own class above it for most real
use.
|
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
source code
|
|
|
|
|
|
|
_transactionDataFactory(self)
Factory method returning TransactionData object |
source code
|
|
|
doGenericSetup(self,
cache=0)
do a default setup for all the normal/necessary yum components,
really just a shorthand for testing |
source code
|
|
|
doConfigSetup(self,
fn=' /etc/yum/yum.conf ' ,
root=' / ' ,
init_plugins=True,
plugin_types=( 0) ,
optparser=None,
debuglevel=None,
errorlevel=None) |
source code
|
|
|
_getConfig(self,
**kwargs)
Parse and load Yum's configuration files and call hooks initialise
plugins and logging. |
source code
|
|
|
doLoggingSetup(self,
debuglevel,
errorlevel,
syslog_ident=None,
syslog_facility=None,
syslog_device=' /dev/log ' )
Perform logging related setup. |
source code
|
|
|
|
|
getReposFromConfigFile(self,
repofn,
repo_age=None,
validate=None)
read in repositories from a config .repo file |
source code
|
|
|
getReposFromConfig(self)
read in repositories from config main and .repo files |
source code
|
|
|
|
|
|
|
doPluginSetup(self,
optparser=None,
plugin_types=None,
searchpath=None,
confpath=None,
disabled_plugins=None,
enabled_plugins=None)
Initialise and enable yum plugins. |
source code
|
|
|
|
|
_getRpmDB(self)
sets up a holder object for important information from the rpmdb |
source code
|
|
|
closeRpmDB(self)
closes down the instances of the rpmdb we have wangling around |
source code
|
|
|
|
|
|
|
_getRepos(self,
thisrepo=None,
doSetup=False)
For each enabled repository set up the basics of the repository. |
source code
|
|
|
|
|
doSackSetup(self,
archlist=None,
thisrepo=None) |
source code
|
|
|
_getSacks(self,
archlist=None,
thisrepo=None)
populates the package sacks for information from our repositories,
takes optional archlist for archs to include |
source code
|
|
|
_delSacks(self)
reset the package sacks back to zero - making sure to nuke the ones
in the repo objects, too - where it matters |
source code
|
|
|
|
|
_getUpdates(self)
setups up the update object in the base class and fills out the
updates, obsoletes and others lists |
source code
|
|
|
|
|
|
|
_getGroups(self)
create the groups object that will store the comps metadata finds the
repos with groups, gets their comps data and merge it into the group
object |
source code
|
|
|
_getTags(self)
create the tags object used to search/report from the pkgtags
metadata |
source code
|
|
|
_getHistory(self)
auto create the history object that to access/append the transaction
history information. |
source code
|
|
|
doSackFilelistPopulate(self)
convenience function to populate the repos with the filelist metadata
it also is simply to only emit a log if anything actually gets
populated |
source code
|
|
|
yumUtilsMsg(self,
func,
prog)
Output a message that the tool requires the yum-utils package, if not
installed. |
source code
|
|
|
buildTransaction(self,
unfinished_transactions_check=True)
go through the packages in the transaction set, find them in the
packageSack or rpmdb, and pack up the ts accordingly |
source code
|
|
|
_doSkipBroken(self,
rescode,
restring,
clear_skipped=True)
do skip broken if it is enabled |
source code
|
|
|
_skipPackagesWithProblems(self,
rescode,
restring)
Remove the packages with depsolve errors and depsolve again |
source code
|
|
|
_checkMissingObsoleted(self)
If multiple packages is obsoleting the same package then the
TS_OBSOLETED can get removed from the transaction so we must make
sure that they, exist and else create them |
source code
|
|
|
_checkUpdatedLeftovers(self)
If multiple packages is updated the same package and this package get
removed because of an dep issue then make sure that all the
TS_UPDATED get removed. |
source code
|
|
|
_getPackagesToRemoveAllArch(self,
po)
get all compatible arch packages in pkgSack |
source code
|
|
|
|
|
|
|
_buildDepTree(self)
create a dictionary with po and deps |
source code
|
|
|
|
|
|
|
_getPackagesToRemove(self,
po,
deptree,
toRemove)
get the (related) pos to remove. |
source code
|
|
|
_getDepsToRemove(self,
po,
deptree,
toRemove) |
source code
|
|
|
_rpmdb_warn_checks(self,
out=None,
warn=True,
chkcmd=' all ' ) |
source code
|
|
|
runTransaction(self,
cb)
takes an rpm callback object, performs the transaction |
source code
|
|
|
|
|
|
|
excludePackages(self,
repo=None)
removes packages from packageSacks based on global exclude lists,
command line excludes and per-repository excludes, takes optional
repo object to use. |
source code
|
|
|
|
|
doLock(self,
lockfile=' /var/run/yum.pid ' )
perform the yum locking, raise yum-based exceptions, not OSErrors |
source code
|
|
|
doUnlock(self,
lockfile=None)
do the unlock for yum |
source code
|
|
|
_lock(self,
filename,
contents='
' ,
mode=511) |
source code
|
|
|
|
|
verifyPkg(self,
fo,
po,
raiseError)
verifies the package is what we expect it to be raiseError =
defaults to 0 - if 1 then will raise a URLGrabError if the file does
not check out. |
source code
|
|
|
verifyChecksum(self,
fo,
checksumType,
csum)
Verify the checksum of the file versus the provided checksum |
source code
|
|
|
downloadPkgs(self,
pkglist,
callback=None,
callback_total=None) |
source code
|
|
|
verifyHeader(self,
fo,
po,
raiseError)
check the header out via it's naevr, internally |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_cleanFiles(self,
exts,
pathattr,
filetype) |
source code
|
|
|
|
|
doPackageLists(self,
pkgnarrow=' all ' ,
patterns=None,
showdups=None,
ignore_case=False)
generates lists of packages, un-reduced, based on pkgnarrow option |
source code
|
|
|
findDeps(self,
pkgs)
Return the dependencies for a given package object list, as well
possible solutions for those dependencies. |
source code
|
|
|
searchGenerator(self,
fields,
criteria,
showdups=True,
keys=False)
Generator method to lighten memory load for some searches. |
source code
|
|
|
|
|
searchPackages(self,
fields,
criteria,
callback=None)
Search specified fields for matches to criteria optional callback
specified to print out results as you go. |
source code
|
|
|
searchPackageProvides(self,
args,
callback=None,
callback_has_matchfor=False) |
source code
|
|
|
doGroupLists(self,
uservisible=0,
patterns=None,
ignore_case=True)
returns two lists of groups, installed groups and available groups
optional 'uservisible' bool to tell it whether or not to return only
groups marked as uservisible |
source code
|
|
|
groupRemove(self,
grpid)
mark all the packages in this group to be removed |
source code
|
|
|
groupUnremove(self,
grpid)
unmark any packages in the group from being removed |
source code
|
|
|
selectGroup(self,
grpid,
group_package_types=[ ] ,
enable_group_conditionals=None)
mark all the packages in the group to be installed returns a list of
transaction members it added to the transaction set Optionally take:
group_package_types=List - overrides self.conf.group_package_types
enable_group_conditionals=Bool - overrides
self.conf.enable_group_conditionals |
source code
|
|
|
deselectGroup(self,
grpid,
force=False)
Without the force option set, this removes packages from being
installed that were added as part of installing one of the group(s). |
source code
|
|
|
getPackageObject(self,
pkgtup)
retrieves a packageObject from a pkgtuple - if we need to pick and
choose which one is best we better call out to some method from here
to pick the best pkgobj if there are more than one response - right
now it's more rudimentary. |
source code
|
|
|
|
|
gpgKeyCheck(self)
checks for the presence of gpg keys in the rpmdb returns 0 if no keys
returns 1 if keys |
source code
|
|
|
returnPackagesByDep(self,
depstring)
Pass in a generic [build]require string and this function will pass
back the packages it finds providing that dep. |
source code
|
|
|
returnPackageByDep(self,
depstring)
Pass in a generic [build]require string and this function will pass
back the best(or first) package it finds providing that dep. |
source code
|
|
|
returnInstalledPackagesByDep(self,
depstring)
Pass in a generic [build]require string and this function will pass
back the installed packages it finds providing that dep. |
source code
|
|
|
|
|
|
|
_pkg2obspkg(self,
po)
Given a package return the package it's obsoleted by and so we should
install instead. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
_add_prob_flags(self,
*flags)
Add all of the passed flags to the tsInfo.probFilterFlags array. |
source code
|
|
|
|
|
|
|
|
|
_add_up_txmbr(self,
requiringPo,
upkg,
ipkg) |
source code
|
|
|
update(self,
po=None,
requiringPo=None,
**kwargs)
try to mark for update the item(s) specified. |
source code
|
|
|
remove(self,
po=None,
**kwargs)
try to find and mark for remove the specified package(s) - if po is
specified then that package object (if it is installed) will be
marked for removal. |
source code
|
|
|
installLocal(self,
pkg,
po=None,
updateonly=False)
handles installs/updates of rpms provided on the filesystem in a
local dir (ie: not from a repo) |
source code
|
|
|
reinstallLocal(self,
pkg,
po=None)
handles reinstall of rpms provided on the filesystem in a local dir
(ie: not from a repo) |
source code
|
|
|
reinstall(self,
po=None,
**kwargs)
Setup the problem filters to allow a reinstall to work, then pass
everything off to install |
source code
|
|
|
downgradeLocal(self,
pkg,
po=None)
handles downgrades of rpms provided on the filesystem in a local dir
(ie: not from a repo) |
source code
|
|
|
_is_local_exclude(self,
po,
pkglist)
returns True if the local pkg should be excluded |
source code
|
|
|
|
|
|
|
history_redo(self,
transaction)
Given a valid historical transaction object, try and repeat that
transaction. |
source code
|
|
|
history_undo(self,
transaction)
Given a valid historical transaction object, try and undo that
transaction. |
source code
|
|
|
|
|
|
|
getKeyForRepo(self,
repo,
callback=None)
Retrieve a key for a repository If needed, prompt for if the key
should be imported using callback |
source code
|
|
|
|
|
processTransaction(self,
callback=None,
rpmTestDisplay=None,
rpmDisplay=None)
Process the current Transaction
- Download Packages
- Check GPG Signatures. |
source code
|
|
|
_downloadPackages(self,
callback)
Download the need packages in the Transaction |
source code
|
|
|
_checkSignatures(self,
pkgs,
callback)
The the signatures of the downloaded packages |
source code
|
|
|
_askForGPGKeyImport(self,
po,
userid,
hexkeyid)
Ask for GPGKeyImport This need to be overloaded in a subclass to make
GPG Key import work |
source code
|
|
|
_doTestTransaction(self,
callback,
display=None)
Do the RPM test transaction |
source code
|
|
|
_doTransaction(self,
callback,
display=None)
do the RPM Transaction |
source code
|
|
|
|
|
add_enable_repo(self,
repoid,
baseurls=[ ] ,
mirrorlist=None,
**kwargs)
add and enable a repo with just a baseurl/mirrorlist and repoid
requires repoid and at least one of baseurl and mirrorlist additional
optional kwargs are: variable_convert=bool (defaults to true) and any
other attribute settable to the normal repo setup ex:
metadata_expire, enable_groups, gpgcheck, cachedir, etc returns the
repo object it added |
source code
|
|
|
setCacheDir(self,
force=False,
tmpdir=' /var/tmp ' ,
reuse=True,
suffix=' /$basearch/$releasever ' )
Set a new cache dir, using misc.getCacheDir() and var. |
source code
|
|
|
|
Inherited from depsolve.Depsolve :
allowedMultipleInstalls ,
cprof_resolveDeps ,
doTsSetup ,
initActionTs ,
isPackageInstalled ,
populateTs ,
prof_resolveDeps ,
resolveDeps ,
whatProvides
Inherited from depsolve.Depsolve (private):
_checkConflicts ,
_checkFileRequires ,
_checkInstall ,
_checkRemove ,
_compare_providers ,
_delTsInfo ,
_dscb_procConflict ,
_dscb_procReq ,
_err_missing_requires ,
_getActionTs ,
_getTs ,
_getTsInfo ,
_isPackageInstalled ,
_prco_req2req ,
_processConflict ,
_processReq ,
_quickWhatProvides ,
_requiringFromInstalled ,
_requiringFromTransaction ,
_resolveRequires ,
_setTsInfo ,
_undoDepInstalls
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|