Command line interface yum class and related.
SIGQUIT handler for the yum cli. This function will print an error message and exit the program.
Parameters: |
|
---|
Bases: yum.Errors.YumBaseError
Command line interface related Exception.
Bases: yum.YumBase, output.YumOutput
This is the base class for yum cli.
Remove data from the yum cache directory. What data is removed depends on the options supplied by the user.
Parameters: | userlist – a list of options. The following are valid options: expire-cache = Eliminate the local data saying when the
metadata and mirror lists were downloaded for each
repository.
packages = Eliminate any cached packages
headers = Eliminate the header files, which old versions
of yum used for dependency resolution
metadata = Eliminate all of the files which yum uses to
determine the remote availability of packages
dbcache = Eliminate the sqlite cache used for faster
access to metadata
rpmdb = Eliminate any cached datat from the local rpmdb
plugins = Tell any enabled plugins to eliminate their
cached data
all = do all of the above
|
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Print out a formatted list of dependencies for a list of packages. This is a cli wrapper method for yum.YumBase.findDeps.
Parameters: | args – a list of names or wildcards specifying packages that should have their dependenices printed |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Upgrade or downgrade packages to match the latest versions available in the enabled repositories.
Parameters: | userlist – list of names or wildcards specifying packages to synchronize with the repositories. If the first string in userlist is “full”, packages will also be reinstalled if their checksums do not match the checksums in the repositories. If userlist is an empty list or only contains “full”, every installed package will be synchronized |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Returns: | (exit_code, [ errors ]) |
---|
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Grab the repomd.xml for each enabled and set up the basics of the repository.
Parameters: |
|
---|
Run a shell-like interface for yum commands.
Returns: | a tuple containing the shell result number, and the shell result messages |
---|
Take care of package downloading, checking, user confirmation and actually running the transaction.
Returns: | a numeric return code, and optionally a list of errors. A negative return code indicates that errors occurred in the pre-transaction checks |
---|
Attempt to take the user specified list of packages or wildcards and downgrade them. If a complete version number if specified, attempt to downgrade them to the specified version
Parameters: | userlist – a list of names or wildcards specifying packages to downgrade |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Take user commands and populate a transaction wrapper with packages to be erased.
Parameters: | userlist – a list of names or wildcards specifying packages to erase |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Parse the error string for ‘interesting’ errors which can be grouped, such as disk space issues.
Parameters: | errstring – the error string |
---|---|
Returns: | a string containing a summary of the errors |
Parse command line arguments, and set up self.conf and self.cmds, as well as logger objects in base instance.
Parameters: | args – a list of command line arguments |
---|
Perform GPG signature verification on the given packages, installing keys if possible.
Parameters: | pkgs – a list of package objects to verify the GPG signatures of |
---|---|
Returns: | non-zero if execution should stop due to an error |
Raises : | Will raise YumBaseError if there’s a problem |
Mark the packages in the given groups for installation.
Parameters: | grouplist – a list of names or wildcards specifying groups to be installed |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Attempt to take the user specified list of packages or wildcards and install them, or if they are installed, update them to a newer version. If a complete version number is specified, attempt to upgrade (or downgrade if they have been removed) them to the specified version.
Parameters: | userlist – a list of names or wildcards specifying packages to install |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Install or update rpms provided on the file system in a local directory (i.e. not from a repository).
Parameters: | filelist – a list of names specifying local rpms |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Read self.cmds and parse them out to make sure that the requested base command and argument makes any sense at all. This function will also set self.basecmd and self.extcmds.
Print out a list of packages that provide the given file or feature. This a cli wrapper to the provides methods in the rpmdb and pkgsack.
Parameters: | args – the name of a file or feature to search for |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Register a yumcommands.YumCommand so that it can be called by any of the names returned by its yumcommands.YumCommand.getNames() method.
Parameters: | command – the yumcommands.YumCommand to register |
---|
Attempt to take the user specified list of packages or wildcards and reinstall them.
Parameters: | userlist – a list of names or wildcards specifying packages to reinstall |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Mark the packages in the given groups for removal.
Parameters: | grouplist – a list of names or wildcards specifying groups to be removed |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Print information about a package that provides the given dependency. Only one package will be printed per dependency.
Parameters: | args – a list of strings specifying dependencies to search for |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Print complete information about the groups that match the given names or wildcards.
Parameters: | userlist – a list of names or wildcards specifying the groups to print information about |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Print out a list of groups that match the given names or wildcards.
Parameters: | extcmds – a list of names or wildcards specifying groups to list |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Print a summary of the groups that match the given names or wildcards.
Parameters: | userlist – a list of names or wildcards specifying the groups to summarise. If userlist is an empty list, all installed and available packages will be summarised |
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Return a yum.misc.GenericHolder object containing lists of package objects that match the given names or wildcards.
Parameters: |
|
---|---|
Returns: | a yum.misc.GenericHolder instance with the following lists defined: available = list of packageObjects
installed = list of packageObjects
updates = tuples of packageObjects (updating, installed)
extras = list of packageObjects
obsoletes = tuples of packageObjects (obsoleting, installed)
recent = list of packageObjects
|
Search for simple text tags in a package object. This is a cli wrapper method for the module search function.
Parameters: | args – list of names or wildcards to search for. Normally this method will begin by searching the package names and summaries, and will only search urls and descriptions if that fails. However, if the first string in args is “all”, this method will always search everything |
---|---|
Returns: | a tuple where the first item is an exit code, and the second item is a generator if the search is a successful, and a list of error messages otherwise |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Print out an explanation of the shell usage.
Take user commands and populate transaction wrapper with packages to be updated.
Parameters: |
|
---|---|
Returns: | (exit_code, [ errors ]) |
exit_code is:
0 = we're done, exit
1 = we've errored, exit with error string
2 = we've got work yet to do, onto the next stage
Print out an explanation of command line usage.
Bases: optparse.OptionParser
Subclass that makes some minor tweaks to make OptionParser do things the “yum way”.
Output an error message, and exit the program. This method is overridden so that error output goes to the logger.
Parameters: | msg – the error message to output |
---|
Parse only command line options that affect basic yum setup.
Parameters: | args – a list of command line options to parse |
---|---|
Returns: | a dictionary containing the values of command line options |
Return the root location to use for the yum operation. This location can be changed by using the –installroot option.
Parameters: | opts – a dictionary containing the values of the command line options |
---|---|
Returns: | a string representing the root location |
Parse command line options.
Parameters: | args – the command line arguments entered by the user |
---|---|
Returns: | (opts, cmds) opts is a dictionary containing the values of command line options. cmds is a list of the command line arguments that were not parsed as options. For example, if args is [“install”, “foo”, “–verbose”], cmds will be [“install”, “foo”]. |