Loading...
Searching...
No Matches
Transaction Set API.
(un)Installing packages:

How to create, run & destroy a package transaction. More...

Collaboration diagram for Transaction Set API.:

## Files

file | rpmte.h
file | rpmts.h

## Typedefs

typedef void *(* | rpmCallbackFunction) (const void *h, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, rpmCallbackData data)
typedef enum rpmtsOpX_e | rpmtsOpX
typedef int(* | rpmtsChangeFunction) (int event, rpmte te, rpmte other, void *data)

## Enumerations

enum

rpmtransFlags_e {
RPMTRANS_FLAG_NONE = 0 , RPMTRANS_FLAG_TEST = (1 << 0) , RPMTRANS_FLAG_BUILD_PROBS = (1 << 1) , RPMTRANS_FLAG_NOSCRIPTS = (1 << 2) ,
RPMTRANS_FLAG_JUSTDB = (1 << 3) , RPMTRANS_FLAG_NOTRIGGERS = (1 << 4) , RPMTRANS_FLAG_NODOCS = (1 << 5) , RPMTRANS_FLAG_ALLFILES = (1 << 6) ,
RPMTRANS_FLAG_NOPLUGINS = (1 << 7) , RPMTRANS_FLAG_NOCONTEXTS = (1 << 8) , RPMTRANS_FLAG_NOCAPS = (1 << 9) , RPMTRANS_FLAG_NODB = (1 << 10) ,
RPMTRANS_FLAG_NOPREUNTRANS = (1 << 14) , RPMTRANS_FLAG_NOPOSTUNTRANS = (1 << 15) , RPMTRANS_FLAG_NOTRIGGERPREIN = (1 << 16) , RPMTRANS_FLAG_NOPRE = (1 << 17) ,
RPMTRANS_FLAG_NOPOST = (1 << 18) , RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19) , RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20) , RPMTRANS_FLAG_NOPREUN = (1 << 21) ,
RPMTRANS_FLAG_NOPOSTUN = (1 << 22) , RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23) , RPMTRANS_FLAG_NOPRETRANS = (1 << 24) , RPMTRANS_FLAG_NOPOSTTRANS = (1 << 25) ,
RPMTRANS_FLAG_NOSYSUSERS = (1 << 26) , RPMTRANS_FLAG_NOMD5 = (1 << 27) , RPMTRANS_FLAG_NOFILEDIGEST = (1 << 27) , RPMTRANS_FLAG_NOARTIFACTS = (1 << 29) ,
RPMTRANS_FLAG_NOCONFIGS = (1 << 30) , RPMTRANS_FLAG_DEPLOOPS = (1 << 31)
}

enum | rpmVSFlags_e { RPMVSF_DEFAULT = 0 , RPMVSF_NOHDRCHK = (1 << 0) , RPMVSF_NEEDPAYLOAD = (1 << 1) , RPMVSF_NOSHA1HEADER = (1 << 8) , RPMVSF_NOSHA256HEADER = (1 << 9) , RPMVSF_NODSAHEADER = (1 << 10) , RPMVSF_NORSAHEADER = (1 << 11) , RPMVSF_NOPAYLOAD = (1 << 16) , RPMVSF_NOMD5 = (1 << 17) , RPMVSF_NODSA = (1 << 18) , RPMVSF_NORSA = (1 << 19) }

enum

rpmtsOpX_e {
RPMTS_OP_TOTAL = 0 , RPMTS_OP_CHECK = 1 , RPMTS_OP_ORDER = 2 , RPMTS_OP_FINGERPRINT = 3 ,
RPMTS_OP_INSTALL = 5 , RPMTS_OP_ERASE = 6 , RPMTS_OP_SCRIPTLETS = 7 , RPMTS_OP_COMPRESS = 8 ,
RPMTS_OP_UNCOMPRESS = 9 , RPMTS_OP_DIGEST = 10 , RPMTS_OP_SIGNATURE = 11 , RPMTS_OP_DBADD = 12 ,
RPMTS_OP_DBREMOVE = 13 , RPMTS_OP_DBGET = 14 , RPMTS_OP_DBPUT = 15 , RPMTS_OP_DBDEL = 16 ,
RPMTS_OP_VERIFY = 17 , RPMTS_OP_MAX = 18
}

## Functions

int | rpmtsCheck (rpmts ts)
int | rpmtsOrder (rpmts ts)
int | rpmtsRun (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
rpmts | rpmtsLink (rpmts ts)
int | rpmtsCloseDB (rpmts ts)
int | rpmtsOpenDB (rpmts ts, int dbmode)
int | rpmtsInitDB (rpmts ts, int perms)
int | rpmtsGetDBMode (rpmts ts)
int | rpmtsSetDBMode (rpmts ts, int dbmode)
int | rpmtsRebuildDB (rpmts ts)
int | rpmtsVerifyDB (rpmts ts)
rpmdbMatchIterator | rpmtsInitIterator (const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
rpmRC | rpmtsImportHeader (rpmtxn txn, Header h, rpmFlags flags)
rpmRC | rpmtsImportPubkey (rpmts ts, const unsigned char *pkt, size_t pktlen)
rpmKeyring | rpmtsGetKeyring (rpmts ts, int autoload)
int | rpmtsSetKeyring (rpmts ts, rpmKeyring keyring)
int | rpmtsSetSolveCallback (rpmts ts, int(*solve)(rpmts ts, rpmds ds, const void *data), const void *solveData)
rpmps | rpmtsProblems (rpmts ts)
void | rpmtsCleanProblems (rpmts ts)
void | rpmtsClean (rpmts ts)
void | rpmtsEmpty (rpmts ts)
rpmts | rpmtsFree (rpmts ts)
rpmVSFlags | rpmtsVSFlags (rpmts ts)
rpmVSFlags | rpmtsSetVSFlags (rpmts ts, rpmVSFlags vsflags)
rpmVSFlags | rpmtsVfyFlags (rpmts ts)
rpmVSFlags | rpmtsSetVfyFlags (rpmts ts, rpmVSFlags vfyflags)
int | rpmtsVfyLevel (rpmts ts)
int | rpmtsSetVfyLevel (rpmts ts, int vfylevel)
const char * | rpmtsRootDir (rpmts ts)
int | rpmtsSetRootDir (rpmts ts, const char *rootDir)
FD_t | rpmtsScriptFd (rpmts ts)
void | rpmtsSetScriptFd (rpmts ts, FD_t scriptFd)
rpm_tid_t | rpmtsGetTid (rpmts ts)
rpm_tid_t | rpmtsSetTid (rpmts ts, rpm_tid_t tid)
rpmdb | rpmtsGetRdb (rpmts ts)
void * | rpmtsNotify (rpmts ts, rpmte te, rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total)
int | rpmtsNElements (rpmts ts)
rpmte | rpmtsElement (rpmts ts, int ix)
rpmprobFilterFlags | rpmtsFilterFlags (rpmts ts)
rpmtransFlags | rpmtsFlags (rpmts ts)
rpmtransFlags | rpmtsSetFlags (rpmts ts, rpmtransFlags transFlags)
rpm_color_t | rpmtsColor (rpmts ts)
rpm_color_t | rpmtsPrefColor (rpmts ts)
rpm_color_t | rpmtsSetColor (rpmts ts, rpm_color_t color)
rpm_color_t | rpmtsSetPrefColor (rpmts ts, rpm_color_t color)
rpmop | rpmtsOp (rpmts ts, rpmtsOpX opx)
rpmPlugins | rpmtsPlugins (rpmts ts)
int | rpmtsSetNotifyCallback (rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
int | rpmtsSetNotifyStyle (rpmts ts, int style)
int | rpmtsGetNotifyStyle (rpmts ts)
int | rpmtsSetChangeCallback (rpmts ts, rpmtsChangeFunction notify, void *data)
rpmts | rpmtsCreate (void)
int | rpmtsAddInstallElement (rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation *relocs)
int | rpmtsAddReinstallElement (rpmts ts, Header h, const fnpyKey key)
int | rpmtsAddRestoreElement (rpmts ts, Header h)
int | rpmtsAddEraseElement (rpmts ts, Header h, int dboffset)
rpmtxn | rpmtxnBegin (rpmts ts, rpmtxnFlags flags)
rpmtxn | rpmtxnEnd (rpmtxn txn)

## RPMRC

rpmRC | rpmInstallSourcePackage (rpmts ts, FD_t fd, char **specFilePtr, char **cookie)

## Detailed Description

How to create, run & destroy a package transaction.

## Typedef Documentation

## rpmCallbackFunction

typedef void *(* rpmCallbackFunction) (const void *h, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, rpmCallbackData data)

Function pointer type for rpmtsSetNotifyCallback() triggered by rpmtsNotify()

Parameters

  h | related header or NULL
  what | kind of notification (See RPMCALLBACK_ constants above)
  amount | number of bytes/packages already processed or tag of the scriptlet involved or 0 or some other number
  total | total number of bytes/packages to be processed or return code of the scriptlet or 0
  key | result of rpmteKey() of related rpmte or 0
  data | user data as passed to rpmtsSetNotifyCallback()

## rpmtsChangeFunction

typedef int(* rpmtsChangeFunction) (int event, rpmte te, rpmte other, void *data)

Transaction change callback type.

On explicit install/erase add events, "other" is NULL, on implicit add events (erasures due to obsolete/upgrade, replaced by newer) it points to the replacing package.

Parameters

  event | Change event (see rpmtsEvent enum)
  te | Transaction element
  other | Related transaction element (or NULL)
  data | Application private data from rpmtsSetChangeCallback()

## rpmtsOpX

typedef enum rpmtsOpX_e rpmtsOpX

Indices for timestamps.

## Enumeration Type Documentation

## rpmtransFlags_e

enum rpmtransFlags_e

Bit(s) to control rpmtsRun() operation.

Enumerator
RPMTRANS_FLAG_TEST | from –test
RPMTRANS_FLAG_BUILD_PROBS | don't process payload
RPMTRANS_FLAG_NOSCRIPTS | from –noscripts
RPMTRANS_FLAG_JUSTDB | from –justdb
RPMTRANS_FLAG_NOTRIGGERS | from –notriggers
RPMTRANS_FLAG_NODOCS | from –excludedocs
RPMTRANS_FLAG_ALLFILES | from –allfiles
RPMTRANS_FLAG_NOPLUGINS | from –noplugins
RPMTRANS_FLAG_NOCONTEXTS | from –nocontexts
RPMTRANS_FLAG_NOCAPS | from –nocaps
RPMTRANS_FLAG_NODB | from –nodb
RPMTRANS_FLAG_NOPREUNTRANS | from –nopreuntrans
RPMTRANS_FLAG_NOPOSTUNTRANS | from –nopostuntrans
RPMTRANS_FLAG_NOTRIGGERPREIN | from –notriggerprein
RPMTRANS_FLAG_NOPRE | from –nopre
RPMTRANS_FLAG_NOPOST | from –nopost
RPMTRANS_FLAG_NOTRIGGERIN | from –notriggerin
RPMTRANS_FLAG_NOTRIGGERUN | from –notriggerun
RPMTRANS_FLAG_NOPREUN | from –nopreun
RPMTRANS_FLAG_NOPOSTUN | from –nopostun
RPMTRANS_FLAG_NOTRIGGERPOSTUN | from –notriggerpostun
RPMTRANS_FLAG_NOPRETRANS | from –nopretrans
RPMTRANS_FLAG_NOPOSTTRANS | from –noposttrans
RPMTRANS_FLAG_NOSYSUSERS | from –nosysusers
RPMTRANS_FLAG_NOMD5 | from –nomd5
RPMTRANS_FLAG_NOFILEDIGEST | from –nofiledigest (alias to –nomd5)
RPMTRANS_FLAG_NOARTIFACTS | from –noartifacts
RPMTRANS_FLAG_NOCONFIGS | from –noconfigs
RPMTRANS_FLAG_DEPLOOPS | from –deploops

## rpmtsOpX_e

enum rpmtsOpX_e

Indices for timestamps.

## rpmVSFlags_e

enum rpmVSFlags_e

Bit(s) to control digest and signature verification.

## Function Documentation

## rpmInstallSourcePackage()

rpmRC rpmInstallSourcePackage | ( | rpmts | ts,
|  | FD_t | fd,
|  | char ** | specFilePtr,
|  | char ** | cookie )

Install source package.

Parameters

  | ts | transaction set
  | fd | file handle
  [out] | specFilePtr | address of spec file name (or NULL)
  [out] | cookie | address of cookie pointer (or NULL)

Returns
  rpmRC return code

## rpmtsAddEraseElement()

int rpmtsAddEraseElement | ( | rpmts | ts,
|  | Header | h,
|  | int | dboffset )

Add package to be erased to transaction set.

Parameters

  ts | transaction set
  h | header
  dboffset | ununsed

Returns
  0 on success, 1 on error (not installed)

## rpmtsAddInstallElement()

int rpmtsAddInstallElement | ( | rpmts | ts,
|  | Header | h,
|  | const fnpyKey | key,
|  | int | upgrade,
|  | rpmRelocation * | relocs )

Add package to be installed to transaction set.

The transaction set is checked for duplicate package names. If found, the package with the "newest" EVR will be replaced.

Parameters

  ts | transaction set
  h | header
  key | package retrieval key (e.g. file name)
  upgrade | is package being upgraded?
  relocs | package file relocations

Returns
  0 on success, 1 on I/O error, 2 needs capabilities

## rpmtsAddReinstallElement()

int rpmtsAddReinstallElement | ( | rpmts | ts,
|  | Header | h,
|  | const fnpyKey | key )

Add package to be reinstalled to transaction set.

Parameters

  ts | transaction set
  h | header
  key | package retrieval key (e.g. file name)

Returns
  0 on success

## rpmtsAddRestoreElement()

int rpmtsAddRestoreElement | ( | rpmts | ts,
|  | Header | h )

Add package to be restored to transaction set.

Parameters

  ts | transaction set
  h | header

Returns
  0 on success, 1 on error (not installed)

## rpmtsCheck()

int rpmtsCheck | ( | rpmts | ts | ) |

Perform dependency resolution on the transaction set.

Any problems found by rpmtsCheck() can be examined by retrieving the problem set with rpmtsProblems(), success here only means that the resolution was successfully attempted for all packages in the set.

Parameters

  ts | transaction set

Returns
  0 on success

## rpmtsClean()

void rpmtsClean | ( | rpmts | ts | ) |

Free memory needed only for dependency checks and ordering.

Parameters

  ts | transaction set

## rpmtsCleanProblems()

void rpmtsCleanProblems | ( | rpmts | ts | ) |

Clean current transaction problem set.

Parameters

  ts | transaction set

## rpmtsCloseDB()

int rpmtsCloseDB | ( | rpmts | ts | ) |

Close the database used by the transaction.

Parameters

  ts | transaction set

Returns
  0 on success

## rpmtsColor()

rpm_color_t rpmtsColor | ( | rpmts | ts | ) |

Retrieve color bits of transaction set.

Parameters

  ts | transaction set

Returns
  color bits

## rpmtsCreate()

rpmts rpmtsCreate | ( | void |  | ) |

Create an empty transaction set.

Returns
  new transaction set

## rpmtsElement()

rpmte rpmtsElement | ( | rpmts | ts,
|  | int | ix )

Return (ordered) transaction set element.

Parameters

  ts | transaction set
  ix | transaction element index

Returns
  transaction element (or NULL)

## rpmtsEmpty()

void rpmtsEmpty | ( | rpmts | ts | ) |

Re-create an empty transaction set.

Parameters

  ts | transaction set

## rpmtsFilterFlags()

rpmprobFilterFlags rpmtsFilterFlags | ( | rpmts | ts | ) |

Get problem ignore bit mask, i.e. bits to filter encountered problems.

Parameters

  ts | transaction set

Returns
  ignore bit mask

## rpmtsFlags()

rpmtransFlags rpmtsFlags | ( | rpmts | ts | ) |

Get transaction flags, i.e. bits that control rpmtsRun().

Parameters

  ts | transaction set

Returns
  transaction flags

## rpmtsFree()

rpmts rpmtsFree | ( | rpmts | ts | ) |

Destroy transaction set, closing the database as well.

Parameters

  ts | transaction set

Returns
  NULL always

## rpmtsGetDBMode()

int rpmtsGetDBMode | ( | rpmts | ts | ) |

Return the transaction database mode

Parameters

  ts | transaction set

Returns
  O_RDONLY, O_RDWR or -1 (lazy opens disabled)

## rpmtsGetKeyring()

rpmKeyring rpmtsGetKeyring | ( | rpmts | ts,
|  | int | autoload )

Retrieve handle for keyring used for this transaction set

Parameters

  ts | transaction set
  autoload | load default keyring if keyring is not set

Returns
  keyring handle (or NULL)

## rpmtsGetNotifyStyle()

int rpmtsGetNotifyStyle | ( | rpmts | ts | ) |

Get transaction notify callback style.

Parameters

  ts | transaction set

Returns
  current callback style (see above)

## rpmtsGetRdb()

rpmdb rpmtsGetRdb | ( | rpmts | ts | ) |

Get transaction set database handle.

Parameters

  ts | transaction set

Returns
  transaction database handle

## rpmtsGetTid()

rpm_tid_t rpmtsGetTid | ( | rpmts | ts | ) |

Get transaction id, i.e. transaction time stamp.

Parameters

  ts | transaction set

Returns
  transaction id

## rpmtsImportHeader()

rpmRC rpmtsImportHeader | ( | rpmtxn | txn,
|  | Header | h,
|  | rpmFlags | flags )

Import a header into the rpmdb

Parameters

  txn | transaction handle
  h | header
  flags | (unused)

Returns
  RPMRC_OK/RPMRC_FAIL

## rpmtsImportPubkey()

rpmRC rpmtsImportPubkey | ( | rpmts | ts,
|  | const unsigned char * | pkt,
|  | size_t | pktlen )

Import public key packet(s).

Todo
  Implicit –update policy for gpg-pubkey headers.

Parameters

  ts | transaction set
  pkt | pgp pubkey packet(s)
  pktlen | pgp pubkey length

Returns
  RPMRC_OK/RPMRC_FAIL

## rpmtsInitDB()

int rpmtsInitDB | ( | rpmts | ts,
|  | int | perms )

Initialize the database used by the transaction.

Parameters

  ts | transaction set
  perms | database permissions (ie mode bits)

Returns
  0 on success

## rpmtsInitIterator()

rpmdbMatchIterator rpmtsInitIterator | ( | const rpmts | ts,
|  | rpmDbiTagVal | rpmtag,
|  | const void * | keyp,
|  | size_t | keylen )

Return transaction database iterator.

Parameters

  ts | transaction set
  rpmtag | database index tag
  keyp | key data (NULL for sequential access)
  keylen | key data length (0 will use strlen(keyp))

Returns
  NULL on failure

## rpmtsLink()

rpmts rpmtsLink | ( | rpmts | ts | ) |

Reference a transaction set instance.

Parameters

  ts | transaction set

Returns
  new transaction set reference

## rpmtsNElements()

int rpmtsNElements | ( | rpmts | ts | ) |

Return number of (ordered) transaction set elements.

Parameters

  ts | transaction set

Returns
  no. of transaction set elements

## rpmtsNotify()

void * rpmtsNotify | ( | rpmts | ts,
|  | rpmte | te,
|  | rpmCallbackType | what,
|  | rpm_loff_t | amount,
|  | rpm_loff_t | total )

Perform transaction progress notify callback.

Parameters

  ts | transaction set
  te | current transaction element
  what | type of call back
  amount | current value
  total | final value

Returns
  callback dependent pointer

## rpmtsOp()

rpmop rpmtsOp | ( | rpmts | ts,
|  | rpmtsOpX | opx )

Retrieve operation timestamp from a transaction set.

Parameters

  ts | transaction set
  opx | operation timestamp index

Returns
  pointer to operation timestamp.

## rpmtsOpenDB()

int rpmtsOpenDB | ( | rpmts | ts,
|  | int | dbmode )

Open the database used by the transaction.

Parameters

  ts | transaction set
  dbmode | O_RDONLY or O_RDWR

Returns
  0 on success

## rpmtsOrder()

int rpmtsOrder | ( | rpmts | ts | ) |

Determine package order in a transaction set according to dependencies.

Order packages, returning error if circular dependencies cannot be eliminated by removing Requires's from the loop(s). Only dependencies from added or removed packages are used to determine ordering using a topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify that all dependencies can be resolved.

The final order ends up as installed packages followed by removed packages, with packages removed for upgrades immediately following the new package to be installed.

Parameters

  ts | transaction set

Returns
  no. of (added) packages that could not be ordered

## rpmtsPlugins()

rpmPlugins rpmtsPlugins | ( | rpmts | ts | ) |

Get the plugins associated with a transaction set

Parameters

  ts | transaction set

Returns
  plugins

## rpmtsPrefColor()

rpm_color_t rpmtsPrefColor | ( | rpmts | ts | ) |

Retrieve preferred file color

Parameters

  ts | transaction set

Returns
  color bits

## rpmtsProblems()

rpmps rpmtsProblems | ( | rpmts | ts | ) |

Return current transaction set problems.

Parameters

  ts | transaction set

Returns
  current problem set (or NULL if no problems)

## rpmtsRebuildDB()

int rpmtsRebuildDB | ( | rpmts | ts | ) |

Rebuild the database used by the transaction.

Parameters

  ts | transaction set

Returns
  0 on success

## rpmtsRootDir()

const char * rpmtsRootDir | ( | rpmts | ts | ) |

Get transaction rootDir, i.e. path to chroot(2).

Parameters

  ts | transaction set

Returns
  transaction rootDir

## rpmtsRun()

int rpmtsRun | ( | rpmts | ts,
|  | rpmps | okProbs,
|  | rpmprobFilterFlags | ignoreSet )

Process all package elements in a transaction set. Before calling rpmtsRun be sure to have:

- setup the rpm root dir via rpmtsSetRoot().
- setup the rpm notify callback via rpmtsSetNotifyCallback().
- setup the rpm transaction flags via rpmtsSetFlags().

Additionally, though not required you may want to:

- setup the rpm verify signature flags via rpmtsSetVSFlags().

Parameters

  ts | transaction set
  okProbs | unused
  ignoreSet | bits to filter problem types

Returns
  0 on success, -1 on error, >0 with newProbs set

## rpmtsScriptFd()

FD_t rpmtsScriptFd | ( | rpmts | ts | ) |

Get transaction script file handle, i.e. stdout/stderr on scriptlet execution

Parameters

  ts | transaction set

Returns
  transaction script file handle

## rpmtsSetChangeCallback()

int rpmtsSetChangeCallback | ( | rpmts | ts,
|  | rpmtsChangeFunction | notify,
|  | void * | data )

Set transaction change callback function and argument.

The change callback gets called when transaction elements are added, replaced or removed from a transaction set.

Parameters

  ts | transaction set
  notify | element change callback
  data | element change callback private data

Returns
  0 on success

## rpmtsSetColor()

rpm_color_t rpmtsSetColor | ( | rpmts | ts,
|  | rpm_color_t | color )

Set color bits of transaction set.

Parameters

  ts | transaction set
  color | new color bits

Returns
  previous color bits

## rpmtsSetDBMode()

int rpmtsSetDBMode | ( | rpmts | ts,
|  | int | dbmode )

Set the transaction database mode. Only permitted when when backing database hasn't been opened yet (ie rpmtsGetRdb(ts) == NULL)

Parameters

  ts | transaction set
  dbmode | O_RDONLY, O_RDWR or -1 (disable lazy opens)

Returns
  0 on success, 1 on error

## rpmtsSetFlags()

rpmtransFlags rpmtsSetFlags | ( | rpmts | ts,
|  | rpmtransFlags | transFlags )

Set transaction flags, i.e. bits that control rpmtsRun().

Parameters

  ts | transaction set
  transFlags | new transaction flags

Returns
  previous transaction flags

## rpmtsSetKeyring()

int rpmtsSetKeyring | ( | rpmts | ts,
|  | rpmKeyring | keyring )

Set keyring to use for this transaction set. Keyring can be only changed while the underlying rpm database is not yet open.

Parameters

  ts | transaction set
  keyring | keyring handle (NULL to free current keyring)

Returns
  0 on success, -1 on error

## rpmtsSetNotifyCallback()

int rpmtsSetNotifyCallback | ( | rpmts | ts,
|  | rpmCallbackFunction | notify,
|  | rpmCallbackData | notifyData )

Set transaction notify callback function and argument.

Warning
  This call must be made before rpmtsRun() for install/upgrade/freshen to function correctly.

Parameters

  ts | transaction set
  notify | progress callback
  notifyData | progress callback private data

Returns
  0 on success

## rpmtsSetNotifyStyle()

int rpmtsSetNotifyStyle | ( | rpmts | ts,
|  | int | style )

Set transaction notify callback style.

Parameters

  ts | transaction set
  style | 0 (default) for header, 1 for transaction element as the first argument

Returns
  0 on success

## rpmtsSetPrefColor()

rpm_color_t rpmtsSetPrefColor | ( | rpmts | ts,
|  | rpm_color_t | color )

Set preferred file color

Parameters

  ts | transaction set
  color | new color bits

Returns
  previous color bits

## rpmtsSetRootDir()

int rpmtsSetRootDir | ( | rpmts | ts,
|  | const char * | rootDir )

Set transaction rootDir, i.e. path to chroot(2).

Note that rpm assumes the environment inside the root is set up by the caller, such as any mounts needed for the operation inside the root directory.

Parameters

  ts | transaction set
  rootDir | new transaction rootDir (or NULL)

Returns
  0 on success, -1 on error (invalid rootDir)

## rpmtsSetScriptFd()

void rpmtsSetScriptFd | ( | rpmts | ts,
|  | FD_t | scriptFd )

Set transaction script file handle, i.e. stdout/stderr on scriptlet execution

Parameters

  ts | transaction set
  scriptFd | new script file handle (or NULL)

## rpmtsSetSolveCallback()

int rpmtsSetSolveCallback | ( | rpmts | ts,
|  | int(*)(rpmts ts, rpmds ds, const void *data) | solve,
|  | const void * | solveData )

Set dependency solver callback.

Parameters

  ts | transaction set
  (*solve) | dependency solver callback
  solveData | dependency solver callback data (opaque)

Returns
  0 on success

## rpmtsSetTid()

rpm_tid_t rpmtsSetTid | ( | rpmts | ts,
|  | rpm_tid_t | tid )

Set transaction id, i.e. transaction time stamp.

Parameters

  ts | transaction set
  tid | new transaction id

Returns
  previous transaction id

## rpmtsSetVfyFlags()

rpmVSFlags rpmtsSetVfyFlags | ( | rpmts | ts,
|  | rpmVSFlags | vfyflags )

Set package verify flag(s).

Parameters

  ts | transaction set
  vfyflags | new package verify flags

Returns
  old package verify flags

## rpmtsSetVfyLevel()

int rpmtsSetVfyLevel | ( | rpmts | ts,
|  | int | vfylevel )

Set enforced package verify level

Parameters

  ts | transaction set
  vfylevel | new package verify level

Returns
  old package verify level

## rpmtsSetVSFlags()

rpmVSFlags rpmtsSetVSFlags | ( | rpmts | ts,
|  | rpmVSFlags | vsflags )

Set verify signatures flag(s).

Parameters

  ts | transaction set
  vsflags | new verify signatures flags

Returns
  previous value

## rpmtsVerifyDB()

int rpmtsVerifyDB | ( | rpmts | ts | ) |

Verify the database used by the transaction.

Parameters

  ts | transaction set

Returns
  0 on success

## rpmtsVfyFlags()

rpmVSFlags rpmtsVfyFlags | ( | rpmts | ts | ) |

Get package verify flag(s).

Parameters

  ts | transaction set

Returns
  verify signatures flags

## rpmtsVfyLevel()

int rpmtsVfyLevel | ( | rpmts | ts | ) |

Get enforced package verify level

Parameters

  ts | transaction set

Returns
  package verify level

## rpmtsVSFlags()

rpmVSFlags rpmtsVSFlags | ( | rpmts | ts | ) |

Get verify signatures flag(s).

Parameters

  ts | transaction set

Returns
  verify signatures flags

## rpmtxnBegin()

rpmtxn rpmtxnBegin | ( | rpmts | ts,
|  | rpmtxnFlags | flags )

Create a transaction (lock) handle

Parameters

  ts | transaction set
  flags | flags

Returns
  transaction handle

## rpmtxnEnd()

rpmtxn rpmtxnEnd | ( | rpmtxn | txn | ) |

Destroy transaction (lock) handle

Parameters

  txn | transaction handle

Returns
  NULL always