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

# lib/rpmts.c File Reference

Routine(s) to handle a "rpmts" transaction sets. More...

`#include "system.h"`
`#include "rpmio_internal.h"`
`#include <rpmlib.h>`
`#include <rpmmacro.h>`
`#include "rpmdb.h"`
`#include "rpmal.h"`
`#include "rpmds.h"`
`#include "rpmfi.h"`
`#include "rpmte.h"`
`#include "rpmts.h"`
`#include "debug.h"`

Go to the source code of this file.

## Defines

#define | _RPMTE_INTERNAL
#define | _RPMTS_INTERNAL

## Functions

char * | hGetNEVR (Header h, const char **np)
| Return (malloc'd) header name-version-release string. More...
rpmts | XrpmtsUnlink (rpmts ts, const char *msg, const char *fn, unsigned ln)
rpmts | XrpmtsLink (rpmts ts, const char *msg, const char *fn, unsigned ln)
int | rpmtsCloseDB (rpmts ts)
int | rpmtsOpenDB (rpmts ts, int dbmode)
int | rpmtsInitDB (rpmts ts, int dbmode)
int | rpmtsRebuildDB (rpmts ts)
int | rpmtsVerifyDB (rpmts ts)
rpmdbMatchIterator | rpmtsInitIterator (const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)
rpmRC | rpmtsFindPubkey (rpmts ts)
| Retrieve pubkey from rpm database. More...
int | rpmtsCloseSDB (rpmts ts)
int | rpmtsOpenSDB (rpmts ts, int dbmode)
int | sugcmp (const void *a, const void *b)
| Compare suggested package resolutions (qsort/bsearch). More...
int | rpmtsSolve (rpmts ts, rpmds ds, const void *data)
| Attempt to solve a needed dependency using the solve database. More...
int | rpmtsAvailable (rpmts ts, const rpmds ds)
| Attempt to solve a needed dependency using memory resident tables. More...
int | rpmtsSetSolveCallback (rpmts ts, int(*solve)(rpmts ts, rpmds key, const void *data), const void *solveData)
rpmps | rpmtsProblems (rpmts ts)
| Return current transaction set problems. More...
void | rpmtsCleanDig (rpmts ts)
void | rpmtsClean (rpmts ts)
void | rpmtsEmpty (rpmts ts)
rpmts | rpmtsFree (rpmts ts)
rpmVSFlags | rpmtsVSFlags (rpmts ts)
rpmVSFlags | rpmtsSetVSFlags (rpmts ts, rpmVSFlags vsflags)
int | rpmtsUnorderedSuccessors (rpmts ts, int first)
const char * | rpmtsRootDir (rpmts ts)
void | rpmtsSetRootDir (rpmts ts, const char *rootDir)
const char * | rpmtsCurrDir (rpmts ts)
void | rpmtsSetCurrDir (rpmts ts, const char *currDir)
FD_t | rpmtsScriptFd (rpmts ts)
void | rpmtsSetScriptFd (rpmts ts, FD_t scriptFd)
int | rpmtsChrootDone (rpmts ts)
int | rpmtsSetChrootDone (rpmts ts, int chrootDone)
int_32 | rpmtsGetTid (rpmts ts)
int_32 | rpmtsSetTid (rpmts ts, int_32 tid)
int_32 | rpmtsSigtag (const rpmts ts)
int_32 | rpmtsSigtype (const rpmts ts)
const void * | rpmtsSig (const rpmts ts)
int_32 | rpmtsSiglen (const rpmts ts)
int | rpmtsSetSig (rpmts ts, int_32 sigtag, int_32 sigtype, const void *sig, int_32 siglen)
pgpDig | rpmtsDig (rpmts ts)
pgpDigParams | rpmtsSignature (const rpmts ts)
pgpDigParams | rpmtsPubkey (const rpmts ts)
rpmdb | rpmtsGetRdb (rpmts ts)
int | rpmtsInitDSI (const rpmts ts)
void | rpmtsUpdateDSI (const rpmts ts, dev_t dev, uint_32 fileSize, uint_32 prevSize, uint_32 fixupSize, fileAction action)
void | rpmtsCheckDSIProblems (const rpmts ts, const rpmte te)
void * | rpmtsNotify (rpmts ts, rpmte te, rpmCallbackType what, unsigned long amount, unsigned long total)
| Perform transaction progress notify callback. More...
int | rpmtsNElements (rpmts ts)
| Return number of (ordered) transaction set elements. More...
rpmte | rpmtsElement (rpmts ts, int ix)
| Return (ordered) transaction set element. More...
rpmprobFilterFlags | rpmtsFilterFlags (rpmts ts)
rpmtransFlags | rpmtsFlags (rpmts ts)
rpmtransFlags | rpmtsSetFlags (rpmts ts, rpmtransFlags transFlags)
int | rpmtsSetNotifyCallback (rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
int | rpmtsGetKeys (const rpmts ts, fnpyKey **ep, int *nep)
rpmts | rpmtsCreate (void)

## Variables

int | _rpmts_debug = 0

## Detailed Description

Routine(s) to handle a "rpmts" transaction sets.

Definition in file rpmts.c.

## Define Documentation

#define _RPMTE_INTERNAL

| Definition at line 17 of file rpmts.c.

#define _RPMTS_INTERNAL

| Definition at line 20 of file rpmts.c.

## Function Documentation

char* hGetNEVR | ( | Header | h,
|  | const char ** | np
| ) |

Return (malloc'd) header name-version-release string.

Parameters:

  h | header

Return values:

  np | name tag value

Returns:
  name-version-release string

Definition at line 68 of file rpmts.c.

References headerNVR, stpcpy, and xcalloc.

int rpmtsAvailable | ( | rpmts | ts,
|  | const rpmds | ds
| ) |

Attempt to solve a needed dependency using memory resident tables.

Deprecated:
  This function will move from rpmlib to the python bindings.

Parameters:

  ts | transaction set
  ds | dependency set

Returns:
  0 if resolved (and added to ts), 1 not found

Definition at line 499 of file rpmts.c.

References _free, rpmalAllSatisfiesDepend, rpmds, rpmts, and xrealloc.

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

Return (ordered) transaction set element.

Parameters:

  ts | transaction set
  ix | transaction element index

Returns:
  transaction element

Definition at line 1072 of file rpmts.c.

References rpmte, and rpmts.

rpmRC rpmtsFindPubkey | ( | rpmts | ts | ) |

Retrieve pubkey from rpm database.

Parameters:

  ts | rpm transaction

Returns:
  RPMRC_OK on success, RPMRC_NOKEY if not found

Definition at line 173 of file rpmts.c.

References _free, b64decode, pgpDigParams_s::hash_algo, headerFreeData, headerGetEntry, int_32, PGPARMOR_PUBKEY, pgpPrtPkts, PGPPUBKEYALGO_DSA, PGPPUBKEYALGO_RSA, pgpReadPkts, pgpDigParams_s::pubkey_algo, rpmdbFreeIterator, rpmdbGetIteratorFileNum, rpmdbNextIterator, rpmExpand, rpmRC, RPMRC_NOKEY, RPMRC_OK, RPMTAG_PUBKEYS, rpmts, rpmtsDig, rpmtsInitIterator, rpmtsSig, rpmtsSignature, and pgpDigParams_s::signid.

int rpmtsNElements | ( | rpmts | ts | ) |

Return number of (ordered) transaction set elements.

Parameters:

  ts | transaction set

Returns:
  no. of transaction set elements

Definition at line 1063 of file rpmts.c.

References rpmts.

void* rpmtsNotify | ( | rpmts | ts,
|  | rpmte | te,
|  | rpmCallbackType | what,
|  | unsigned long | amount,
|  | unsigned long | 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

Definition at line 1047 of file rpmts.c.

References rpmte, rpmts, and TR_ADDED.

rpmps rpmtsProblems | ( | rpmts | ts | ) |

Return current transaction set problems.

Parameters:

  ts | transaction set

Returns:
  current problem set (or NULL)

Definition at line 542 of file rpmts.c.

References rpmpsLink, and rpmts.

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

| Definition at line 525 of file rpmts.c. References rpmds, and rpmts.

int rpmtsSolve | ( | rpmts | ts,
|  | rpmds | ds,
|  | const void * | data
| ) |

Attempt to solve a needed dependency using the solve database.

Parameters:

  ts | transaction set
  ds | dependency set
  data | opaque data associated with callback

Returns:
  -1 retry, 0 ignore, 1 not found

Definition at line 345 of file rpmts.c.

References _, _free, Fclose, Ferror, Fopen, Fstrerror, headerFree, headerGetEntry, headerLink, headerSprintf, int_32, rpmdbFreeIterator, rpmdbInitIterator, rpmdbNextIterator, rpmds, rpmdsAnyMatchesDep, rpmdsN, rpmdsTagN, rpmExpand, rpmRC, RPMRC_NOKEY, RPMRC_NOTTRUSTED, RPMRC_OK, rpmReadPackageFile, rpmTag, RPMTAG_BASENAMES, RPMTAG_BUILDTIME, RPMTAG_NAME, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, RPMTRANS_FLAG_ADDINDEPS, rpmts, rpmtsAddInstallElement, rpmtsOpenSDB, sugcmp, and xrealloc.

Referenced by rpmtsCreate.

int sugcmp | ( | const void * | a,
|  | const void * | b
| ) | `[static]`

Compare suggested package resolutions (qsort/bsearch).

Parameters:

  a | 1st instance address
  b | 2nd instance address

Returns:
  result of comparison

Definition at line 334 of file rpmts.c.

Referenced by rpmtsSolve.

rpmts XrpmtsLink | ( | rpmts | ts,
|  | const char * | msg,
|  | const char * | fn,
|  | unsigned | ln
| ) |

Todo:
  Remove debugging entry from the ABI.

Definition at line 97 of file rpmts.c.

References rpmts.

rpmts XrpmtsUnlink | ( | rpmts | ts,
|  | const char * | msg,
|  | const char * | fn,
|  | unsigned | ln
| ) |

Todo:
  Remove debugging entry from the ABI.

Definition at line 87 of file rpmts.c.

References rpmts.

## Variable Documentation

int _rpmts_debug = 0

| Definition at line 66 of file rpmts.c.