# Dependency Set API.

## Typedefs
typedef enum rpmsenseFlags_e | rpmsenseFlags
| Dependency Attributes.
## Enumerations
enum | rpmsenseFlags_e { RPMSENSE_ANY = 0, RPMSENSE_LESS = (1 << 1), RPMSENSE_GREATER = (1 << 2), RPMSENSE_EQUAL = (1 << 3), RPMSENSE_PROVIDES = (1 << 4), RPMSENSE_CONFLICTS = (1 << 5), RPMSENSE_OBSOLETES = (1 << 7), RPMSENSE_INTERP = (1 << 8), RPMSENSE_SCRIPT_PRE = ((1 << 9)| RPMSENSE_ANY ), RPMSENSE_SCRIPT_POST = ((1 << 10)| RPMSENSE_ANY ), RPMSENSE_SCRIPT_PREUN = ((1 << 11)| RPMSENSE_ANY ), RPMSENSE_SCRIPT_POSTUN = ((1 << 12)| RPMSENSE_ANY ), RPMSENSE_SCRIPT_VERIFY = (1 << 13), RPMSENSE_FIND_REQUIRES = (1 << 14), RPMSENSE_FIND_PROVIDES = (1 << 15), RPMSENSE_TRIGGERIN = (1 << 16), RPMSENSE_TRIGGERUN = (1 << 17), RPMSENSE_TRIGGERPOSTUN = (1 << 18), RPMSENSE_MISSINGOK = (1 << 19), RPMSENSE_SCRIPT_PREP = (1 << 20), RPMSENSE_SCRIPT_BUILD = (1 << 21), RPMSENSE_SCRIPT_INSTALL = (1 << 22), RPMSENSE_SCRIPT_CLEAN = (1 << 23), RPMSENSE_RPMLIB = ((1 << 24) | RPMSENSE_ANY ), RPMSENSE_TRIGGERPREIN = (1 << 25), RPMSENSE_KEYRING = (1 << 26), RPMSENSE_PATCHES = (1 << 27), RPMSENSE_CONFIG = (1 << 28) }
| Dependency Attributes. More...
## Functions
rpmds | rpmdsUnlink (rpmds ds, const char *msg)
| Unreference a dependency set instance.
rpmds | rpmdsLink (rpmds ds, const char *msg)
| Reference a dependency set instance.
rpmds | rpmdsFree (rpmds ds)
| Destroy a dependency set.
rpmds | rpmdsNew (Header h, rpmTag tagN, int flags)
| Create and load a dependency set.
char * | rpmdsNewDNEVR (const char *dspfx, const rpmds ds)
| Return new formatted dependency string.
rpmds | rpmdsThis (Header h, rpmTag tagN, rpmsenseFlags Flags)
| Create, load and initialize a dependency for this header.
rpmds | rpmdsSingle (rpmTag tagN, const char *N, const char *EVR, rpmsenseFlags Flags)
| Create, load and initialize a dependency set of size 1.
int | rpmdsCount (const rpmds ds)
| Return dependency set count.
int | rpmdsIx (const rpmds ds)
| Return dependency set index.
int | rpmdsSetIx (rpmds ds, int ix)
| Set dependency set index.
const char * | rpmdsDNEVR (const rpmds ds)
| Return current formatted dependency string.
const char * | rpmdsN (const rpmds ds)
| Return current dependency name.
const char * | rpmdsEVR (const rpmds ds)
| Return current dependency epoch-version-release.
rpmsenseFlags | rpmdsFlags (const rpmds ds)
| Return current dependency flags.
rpmTag | rpmdsTagN (const rpmds ds)
| Return current dependency type.
time_t | rpmdsBT (const rpmds ds)
| Return dependency build time.
time_t | rpmdsSetBT (const rpmds ds, time_t BT)
| Set dependency build time.
int | rpmdsNoPromote (const rpmds ds)
| Return current "Don't promote Epoch:" flag.
int | rpmdsSetNoPromote (rpmds ds, int nopromote)
| Set "Don't promote Epoch:" flag.
rpm_color_t | rpmdsColor (const rpmds ds)
| Return current dependency color.
rpm_color_t | rpmdsSetColor (const rpmds ds, rpm_color_t color)
| Return current dependency color.
int32_t | rpmdsRefs (const rpmds ds)
| Return current dependency file refs.
int32_t | rpmdsSetRefs (const rpmds ds, int32_t refs)
| Return current dependency color.
void | rpmdsNotify (rpmds ds, const char *where, int rc)
| Notify of results of dependency match.
int | rpmdsNext (rpmds ds)
| Return next dependency set iterator index.
rpmds | rpmdsInit (rpmds ds)
| Initialize dependency set iterator.
int | rpmdsFind (rpmds ds, const rpmds ods)
| Find a dependency set element using binary search.
int | rpmdsMerge (rpmds *dsp, rpmds ods)
| Merge a dependency set maintaining (N,EVR,Flags) sorted order.
int | rpmdsSearch (rpmds ds, rpmds ods)
| Search a sorted dependency set for an element that overlaps.
int | rpmdsCompare (const rpmds A, const rpmds B)
| Compare two versioned dependency ranges, looking for overlap.
void | rpmdsProblem (rpmps ps, const char *pkgNEVR, const rpmds ds, const fnpyKey *suggestedKeys, int adding)
| Report a Requires: or Conflicts: dependency problem.
int | rpmdsAnyMatchesDep (const Header h, const rpmds req, int nopromote)
| Compare package provides dependencies from header with a single dependency.
int | rpmdsNVRMatchesDep (const Header h, const rpmds req, int nopromote)
| Compare package name-version-release from header with a single dependency.

## Typedef Documentation

typedef enum rpmsenseFlags_e rpmsenseFlags

Dependency Attributes.

## Enumeration Type Documentation

enum rpmsenseFlags_e

Dependency Attributes.

Enumerator:

  RPMSENSE_ANY |
  RPMSENSE_LESS |
  RPMSENSE_GREATER |
  RPMSENSE_EQUAL |
  RPMSENSE_PROVIDES |
  RPMSENSE_CONFLICTS |
  RPMSENSE_OBSOLETES |
  RPMSENSE_INTERP | Interpreter used by scriptlet.
  RPMSENSE_SCRIPT_PRE | pre dependency.
  RPMSENSE_SCRIPT_POST | post dependency.
  RPMSENSE_SCRIPT_PREUN | preun dependency.
  RPMSENSE_SCRIPT_POSTUN | postun dependency.
  RPMSENSE_SCRIPT_VERIFY | verify dependency.
  RPMSENSE_FIND_REQUIRES | find-requires generated dependency.
  RPMSENSE_FIND_PROVIDES | find-provides generated dependency.
  RPMSENSE_TRIGGERIN | triggerin dependency.
  RPMSENSE_TRIGGERUN | triggerun dependency.
  RPMSENSE_TRIGGERPOSTUN | triggerpostun dependency.
  RPMSENSE_MISSINGOK | suggests/enhances hint.
  RPMSENSE_SCRIPT_PREP | prep build dependency.
  RPMSENSE_SCRIPT_BUILD | build build dependency.
  RPMSENSE_SCRIPT_INSTALL | install build dependency.
  RPMSENSE_SCRIPT_CLEAN | clean build dependency.
  RPMSENSE_RPMLIB | rpmlib(feature) dependency.
  RPMSENSE_TRIGGERPREIN | triggerprein dependency.
  RPMSENSE_KEYRING |
  RPMSENSE_PATCHES |
  RPMSENSE_CONFIG |

Definition at line 29 of file rpmds.h.

## Function Documentation

int rpmdsAnyMatchesDep | ( | const Header | h,
|  | const rpmds | req,
|  | int | nopromote |
| ) |  |  |

Compare package provides dependencies from header with a single dependency.

Parameters:

  | h | header
  | req | dependency set
  | nopromote | Don't promote Epoch: in comparison?

Returns:
  1 if any dependency overlaps, 0 otherwise

time_t rpmdsBT | ( | const rpmds | ds | ) |

Return dependency build time.

Parameters:

  | ds | dependency set

Returns:
  dependency build time, 0 on invalid

rpm_color_t rpmdsColor | ( | const rpmds | ds | ) |

Return current dependency color.

Parameters:

  | ds | dependency set

Returns:
  current dependency color

int rpmdsCompare | ( | const rpmds | A,
|  | const rpmds | B |
| ) |  |  |

Compare two versioned dependency ranges, looking for overlap.

Parameters:

  | A | 1st dependency
  | B | 2nd dependency

Returns:
  1 if dependencies overlap, 0 otherwise

int rpmdsCount | ( | const rpmds | ds | ) |

Return dependency set count.

Parameters:

  | ds | dependency set

Returns:
  current count

const char* rpmdsDNEVR | ( | const rpmds | ds | ) |

Return current formatted dependency string.

Parameters:

  | ds | dependency set

Returns:
  current dependency DNEVR, NULL on invalid

const char* rpmdsEVR | ( | const rpmds | ds | ) |

Return current dependency epoch-version-release.

Parameters:

  | ds | dependency set

Returns:
  current dependency EVR, NULL on invalid

int rpmdsFind | ( | rpmds | ds,
|  | const rpmds | ods |
| ) |  |  |

Find a dependency set element using binary search.

Parameters:

  | ds | dependency set to search
  | ods | dependency set element to find.

Returns:
  dependency index (or -1 if not found)

rpmsenseFlags rpmdsFlags | ( | const rpmds | ds | ) |

Return current dependency flags.

Parameters:

  | ds | dependency set

Returns:
  current dependency flags, 0 on invalid

rpmds rpmdsFree | ( | rpmds | ds | ) |

Destroy a dependency set.

Parameters:

  | ds | dependency set

Returns:
  NULL always

rpmds rpmdsInit | ( | rpmds | ds | ) |

Initialize dependency set iterator.

Parameters:

  | ds | dependency set

Returns:
  dependency set

int rpmdsIx | ( | const rpmds | ds | ) |

Return dependency set index.

Parameters:

  | ds | dependency set

Returns:
  current index

rpmds rpmdsLink | ( | rpmds | ds,
|  | const char * | msg |
| ) |  |  |

Reference a dependency set instance.

Parameters:

  | ds | dependency set
  | msg |

Returns:
  new dependency set reference

int rpmdsMerge | ( | rpmds * | dsp,
|  | rpmds | ods |
| ) |  |  |

Merge a dependency set maintaining (N,EVR,Flags) sorted order.

Return values:

  | *dsp | (merged) dependency set

Parameters:

  | ods | dependency set to merge

Returns:
  (merged) dependency index

const char* rpmdsN | ( | const rpmds | ds | ) |

Return current dependency name.

Parameters:

  | ds | dependency set

Returns:
  current dependency name, NULL on invalid

rpmds rpmdsNew | ( | Header | h,
|  | rpmTag | tagN,
|  | int | flags |
| ) |  |  |

Create and load a dependency set.

Parameters:

  | h | header
  | tagN | type of dependency
  | flags | unused

Returns:
  new dependency set

char* rpmdsNewDNEVR | ( | const char * | dspfx,
|  | const rpmds | ds |
| ) |  |  |

Return new formatted dependency string.

Parameters:

  | dspfx | formatted dependency string prefix
  | ds | dependency set

Returns:
  new formatted dependency (malloc'ed)

int rpmdsNext | ( | rpmds | ds | ) |

Return next dependency set iterator index.

Parameters:

  | ds | dependency set

Returns:
  dependency set iterator index, -1 on termination

int rpmdsNoPromote | ( | const rpmds | ds | ) |

Return current "Don't promote Epoch:" flag.

This flag controls for Epoch: promotion when a dependency set is compared. If the flag is set (for already installed packages), then an unspecified value will be treated as Epoch: 0. Otherwise (for added packages), the Epoch: portion of the comparison is skipped if the value is not specified, i.e. an unspecified Epoch: is assumed to be equal in dependency comparisons.

Parameters:

  | ds | dependency set

Returns:
  current "Don't promote Epoch:" flag

void rpmdsNotify | ( | rpmds | ds,
|  | const char * | where,
|  | int | rc |
| ) |  |  |

Notify of results of dependency match.

Parameters:

  | ds | dependency set
  | where | where dependency was resolved (or NULL)
  | rc | 0 == YES, otherwise NO

int rpmdsNVRMatchesDep | ( | const Header | h,
|  | const rpmds | req,
|  | int | nopromote |
| ) |  |  |

Compare package name-version-release from header with a single dependency.

Parameters:

  | h | header
  | req | dependency set
  | nopromote | Don't promote Epoch: in comparison?

Returns:
  1 if dependency overlaps, 0 otherwise

void rpmdsProblem | ( | rpmps | ps,
|  | const char * | pkgNEVR,
|  | const rpmds | ds,
|  | const fnpyKey * | suggestedKeys,
|  | int | adding |
| ) |  |  |

Report a Requires: or Conflicts: dependency problem.

Parameters:

  | ps | transaction set problems
  | pkgNEVR | package name/epoch/version/release
  | ds | dependency set
  | suggestedKeys | filename or python object address
  | adding | dependency problem is from added package set?

int32_t rpmdsRefs | ( | const rpmds | ds | ) |

Return current dependency file refs.

Parameters:

  | ds | dependency set

Returns:
  current dependency file refs, -1 on global

int rpmdsSearch | ( | rpmds | ds,
|  | rpmds | ods |
| ) |  |  |

Search a sorted dependency set for an element that overlaps.

A boolean result is saved (if allocated) and accessible through rpmdsResult(ods) afterwards.

Parameters:

  | ds | dependency set to search
  | ods | dependency set element to find.

Returns:
  dependency index (or -1 if not found)

time_t rpmdsSetBT | ( | const rpmds | ds,
|  | time_t | BT |
| ) |  |  |

Set dependency build time.

Parameters:

  | ds | dependency set
  | BT | build time

Returns:
  dependency build time, 0 on invalid

rpm_color_t rpmdsSetColor | ( | const rpmds | ds,
|  | rpm_color_t | color |
| ) |  |  |

Return current dependency color.

Parameters:

  | ds | dependency set
  | color | new dependency color

Returns:
  previous dependency color

int rpmdsSetIx | ( | rpmds | ds,
|  | int | ix |
| ) |  |  |

Set dependency set index.

Parameters:

  | ds | dependency set
  | ix | new index

Returns:
  current index

int rpmdsSetNoPromote | ( | rpmds | ds,
|  | int | nopromote |
| ) |  |  |

Set "Don't promote Epoch:" flag.

Parameters:

  | ds | dependency set
  | nopromote | Should an unspecified Epoch: be treated as Epoch: 0?

Returns:
  previous "Don't promote Epoch:" flag

int32_t rpmdsSetRefs | ( | const rpmds | ds,
|  | int32_t | refs |
| ) |  |  |

Return current dependency color.

Parameters:

  | ds | dependency set
  | refs | new dependency refs

Returns:
  previous dependency refs

rpmds rpmdsSingle | ( | rpmTag | tagN,
|  | const char * | N,
|  | const char * | EVR,
|  | rpmsenseFlags | Flags |
| ) |  |  |

Create, load and initialize a dependency set of size 1.

Parameters:

  | tagN | type of dependency
  | N | name
  | EVR | epoch:version-release
  | Flags | comparison flags

Returns:
  new dependency set

rpmTag rpmdsTagN | ( | const rpmds | ds | ) |

Return current dependency type.

Parameters:

  | ds | dependency set

Returns:
  current dependency type, 0 on invalid

rpmds rpmdsThis | ( | Header | h,
|  | rpmTag | tagN,
|  | rpmsenseFlags | Flags |
| ) |  |  |

Create, load and initialize a dependency for this header.

Parameters:

  | h | header
  | tagN | type of dependency
  | Flags | comparison flags

Returns:
  new dependency set

rpmds rpmdsUnlink | ( | rpmds | ds,
|  | const char * | msg |
| ) |  |  |

Unreference a dependency set instance.

Parameters:

  | ds | dependency set
  | msg |

Returns:
  NULL always