Main Page Modules Data Structures File List Data Fields Globals Related Pages

# Rpmts Class Reference
[PYTHON.]

A python rpm.ts object represents an RPM transaction set. More...

## Detailed Description

A python rpm.ts object represents an RPM transaction set.

The transaction set is the workhorse of RPM. It performs the installation and upgrade of packages. The rpm.ts object is instantiated by the TransactionSet function in the rpm module.

The TransactionSet function takes two optional arguments. The first argument is the root path. The second is the verify signature disable flags, a set of the following bits:

- rpm.RPMVSF_NOHDRCHK if set, don't check rpmdb headers
- rpm.RPMVSF_NEEDPAYLOAD if not set, check header+payload (if possible)
- rpm.RPMVSF_NOSHA1HEADER if set, don't check header SHA1 digest
- rpm.RPMVSF_NODSAHEADER if set, don't check header DSA signature
- rpm.RPMVSF_NOMD5 if set, don't check header+payload MD5 digest
- rpm.RPMVSF_NODSA if set, don't check header+payload DSA signature
- rpm.RPMVSF_NORSA if set, don't check header+payload RSA signature

For convenience, there are the following masks:

- rpm._RPMVSF_NODIGESTS if set, don't check digest(s).
- rpm._RPMVSF_NOSIGNATURES if set, don't check signature(s).

A rpm.ts object has the following methods:

- addInstall(hdr,data,mode) Add an install element to a transaction set.

Parameters:

  hdr | the header to be added
  data | user data that will be passed to the transaction callback during transaction execution
  mode | optional argument that specifies if this package should be installed ('i'), upgraded ('u'), or if it is just available to the transaction when computing dependencies but no action should be performed with it ('a').

- addErase(name) Add an erase element to a transaction set.

Parameters:

  name | the package name to be erased

- check() Perform a dependency check on the transaction set. After headers have been added to a transaction set, a dependency check can be performed to make sure that all package dependencies are satisfied.

Returns:
  None If there are no unresolved dependencies Otherwise a list of complex tuples is returned, one tuple per unresolved dependency, with The format of the dependency tuple is: ((packageName, packageVersion, packageRelease), (reqName, reqVersion), needsFlags, suggestedPackage, sense) packageName, packageVersion, packageRelease are the name, version, and release of the package that has the unresolved dependency or conflict. The reqName and reqVersion are the name and version of the requirement or conflict. The needsFlags is a bitfield that describes the versioned nature of a requirement or conflict. The constants rpm.RPMSENSE_LESS, rpm.RPMSENSE_GREATER, and rpm.RPMSENSE_EQUAL can be logical ANDed with the needsFlags to get versioned dependency information. suggestedPackage is a tuple if the dependency check was aware of a package that solves this dependency problem when the dependency check was run. Packages that are added to the transaction set as "available" are examined during the dependency check as possible dependency solvers. The tuple contains two values, (header, suggestedName). These are set to the header of the suggested package and its name, respectively. If there is no known package to solve the dependency problem, suggestedPackage is None. The constants rpm.RPMDEP_SENSE_CONFLICTS and rpm.RPMDEP_SENSE_REQUIRES are set to show a dependency as a requirement or a conflict.

- ts.order() Do a topological sort of added element relations.

Returns:
  None

- ts.setFlags(transFlags) Set transaction set flags.

Parameters:

  transFlags | - bit(s) to controll transaction operations. The following values can be logically OR'ed together: rpm.RPMTRANS_FLAG_TEST - test mode, do not modify the RPM database, change any files, or run any package scripts rpm.RPMTRANS_FLAG_BUILD_PROBS - only build a list of problems encountered when attempting to run this transaction set rpm.RPMTRANS_FLAG_NOSCRIPTS - do not execute package scripts rpm.RPMTRANS_FLAG_JUSTDB - only make changes to the rpm database, do not modify files. rpm.RPMTRANS_FLAG_NOTRIGGERS - do not run trigger scripts rpm.RPMTRANS_FLAG_NODOCS - do not install files marked as doc rpm.RPMTRANS_FLAG_ALLFILES - create all files, even if a file is marked config(missingok) and an upgrade is being performed. rpm.RPMTRANS_FLAG_KEEPOBSOLETE - do not remove obsoleted packages.

Returns:
  previous transFlags

- ts.setProbFilter(ignoreSet) Set transaction set problem filter.

Parameters:

  problemSetFilter | - control bit(s) to ignore classes of problems, a logical or of one or more of the following bit(s): rpm.RPMPROB_FILTER_IGNOREOS - rpm.RPMPROB_FILTER_IGNOREARCH - rpm.RPMPROB_FILTER_REPLACEPKG - rpm.RPMPROB_FILTER_FORCERELOCATE - rpm.RPMPROB_FILTER_REPLACENEWFILES - rpm.RPMPROB_FILTER_REPLACEOLDFILES - rpm.RPMPROB_FILTER_OLDPACKAGE - rpm.RPMPROB_FILTER_DISKSPACE -

Returns:
  previous ignoreSet

- ts.run(callback,data) Attempt to execute a transaction set. After the transaction set has been populated with install/upgrade or erase actions, the transaction set can be executed by invoking the ts.run() method.

The documentation for this class was generated from the following file:

- python/rpmts-py.c