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

# rpmtrans Class Reference
[PYTHON., PYTHON.]

A python rpmtrans object represents an RPM transaction set. More...

## Detailed Description

A python rpmtrans object represents an RPM transaction set.

The transaction set is the workhorse of RPM. It performs the installation and upgrade of packages. The rpmtrans 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 an open database to perform the transaction set upon.

A rpmtrans object has the following methods:

- add(header,data,mode) Add a binary package to a transaction set.

Parameters:

  header | 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').

- remove

- depcheck() Perform a dependency and conflict 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.RPMDEP_SENSE_LESS, rpm.RPMDEP_SENSE_GREATER, and rpm.RPMDEP_SENSE_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.

- run(flags,problemSetFilter,callback,data) Attempt to execute a transaction set. After the transaction set has been populated with install and upgrade actions, it can be executed by invoking the run() method.

Parameters:

  flags

  - modifies the behavior of the transaction set as it is processed. The following values can be locical ORed 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.

Parameters:

  problemSetFilter

  - control bit(s) to ignore classes of problems, any of
  - 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 -

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

- python/rpmmodule.c