{ "post", RPMSENSE_SCRIPT_POST },
{ "rpmlib", RPMSENSE_RPMLIB },
{ "verify", RPMSENSE_SCRIPT_VERIFY },
+ { "pretrans", RPMSENSE_PRETRANS },
{ NULL, 0 }
};
break;
case PART_PRETRANS:
tag = RPMTAG_PRETRANS;
- tagflags = 0;
+ tagflags = RPMSENSE_PRETRANS;
progtag = RPMTAG_PRETRANSPROG;
flagtag = RPMTAG_PRETRANSFLAGS;
partname = "%pretrans";
int *cachedrc = NULL;
int cacheThis = 0;
int adding = (rpmdsInstance(dep) == 0);
+ rpmsenseFlags dsflags = rpmdsFlags(dep);
retry:
rc = 0; /* assume dependency is satisfied */
* on rpmlib provides. The dependencies look like "rpmlib(YaddaYadda)".
* Check those dependencies now.
*/
- if (rpmdsFlags(dep) & RPMSENSE_RPMLIB) {
+ if (dsflags & RPMSENSE_RPMLIB) {
static int oneshot = -1;
if (oneshot)
oneshot = rpmdsRpmlib(&rpmlibP, NULL);
goto unsatisfied;
}
- /* Search added packages for the dependency. */
- if (rpmalSatisfiesDepend(tsmem->addedPackages, dep) != NULL) {
+ /* Pretrans dependencies can't be satisfied by added packages. */
+ if (!(dsflags & RPMSENSE_PRETRANS) &&
+ rpmalSatisfiesDepend(tsmem->addedPackages, dep) != NULL) {
goto exit;
}
/*
* Search for an unsatisfied dependency.
*/
- if (adding && !retrying && !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOSUGGEST)) {
+ if (adding && !retrying && !(dsflags & RPMSENSE_PRETRANS) &&
+ !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOSUGGEST)) {
xx = rpmtsSolve(ts, dep);
if (xx == 0)
goto exit;
argvAdd(&sdeps, "auto");
if (item & RPMSENSE_PREREQ)
argvAdd(&sdeps, "prereq");
+ if (item & RPMSENSE_PRETRANS)
+ argvAdd(&sdeps, "pretrans");
if (sdeps) {
val = argvJoin(sdeps, ",");
dsflags = rpmdsFlags(requires);
- /* Avoid rpmlib feature and package config dependencies */
- if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG))
+ /* Avoid dependendencies which are not relevant for ordering */
+ if (dsflags & (RPMSENSE_RPMLIB|RPMSENSE_CONFIG|RPMSENSE_PRETRANS))
return 0;
q = rpmalSatisfiesDepend(al, requires);
RPMSENSE_GREATER = (1 << 2),
RPMSENSE_EQUAL = (1 << 3),
/* bits 4-5 unused */
- RPMSENSE_PREREQ = (1 << 6), /* legacy prereq dependency */
- /* bit 7 unused */
+ RPMSENSE_PREREQ = (1 << 6), /* legacy prereq dependency */
+ RPMSENSE_PRETRANS = (1 << 7), /*!< Pre-transaction dependency. */
RPMSENSE_INTERP = (1 << 8), /*!< Interpreter used by scriptlet. */
RPMSENSE_SCRIPT_PRE = (1 << 9), /*!< %pre dependency. */
RPMSENSE_SCRIPT_POST = (1 << 10), /*!< %post dependency. */
RPMSENSE_FIND_REQUIRES | \
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
+ RPMSENSE_PRETRANS | \
RPMSENSE_PREREQ)
#define _notpre(_x) ((_x) & ~RPMSENSE_PREREQ)
#define _INSTALL_ONLY_MASK \
- _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING)
+ _notpre(RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_RPMLIB|RPMSENSE_KEYRING|RPMSENSE_PRETRANS)
#define _ERASE_ONLY_MASK \
_notpre(RPMSENSE_SCRIPT_PREUN|RPMSENSE_SCRIPT_POSTUN)