int rpmtsAddInstallElement(rpmts ts, Header h,
fnpyKey key, int upgrade, rpmRelocation * relocs)
{
- HGE_t hge = (HGE_t)headerGetEntryMinMemory;
+ uint_32 tscolor = rpmtsColor(ts);
+ uint_32 dscolor;
int isSource;
int duplicate = 0;
rpmtsi pi; rpmte p;
int ec = 0;
int rc;
int oc;
-uint_32 *mlmp, multiLibMask, oldMultiLibMask;
/*
* Check for previously added versions with the same name.
pkgKey = rpmalAdd(&ts->addedPackages, pkgKey, rpmteKey(p),
rpmteDS(p, RPMTAG_PROVIDENAME),
- rpmteFI(p, RPMTAG_BASENAMES));
+ rpmteFI(p, RPMTAG_BASENAMES), tscolor);
if (pkgKey == RPMAL_NOMATCH) {
/*@-boundswrite@*/
ts->order[oc] = rpmteFree(ts->order[oc]);
}
(void) rpmteSetAddedKey(p, pkgKey);
-#ifdef NOYET
- /* XXX MULTLIBTODO: search over ts->order, not ts->addedPackages */
-
- multiLibMask = 0;
- if (hge(h, RPMTAG_MULTILIBMASK, NULL, (void **) &mlmp, NULL)
- && mlmp != NULL)
- multiLibMask = *mlmp;
-
- if (multiLibMask) {
- for (i = 0; i < ts->orderCount - 1; i++) {
- if (!strcmp (rpmteN(p), al->list[i].name)
- && hge(al->list[i].h, RPMTAG_MULTILIBMASK, NULL,
- (void **) &mlmp, NULL)
- && !rpmVersionCompare(p->h, al->list[i].h)
- && *mlmp && !(*mlmp & multiLibMask))
- (void) rpmteSetMultiLib(p, multiLibMask);
- }
- }
-#endif
-
if (!duplicate) {
ts->numAddedPackages++;
}
goto exit;
}
-/*@-boundsread@*/
- { rpmdbMatchIterator mi;
- Header oh;
-
- mi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, rpmteN(p), 0);
- while((oh = rpmdbNextIterator(mi)) != NULL) {
- if (rpmVersionCompare(h, oh))
- xx = removePackage(ts, oh, rpmdbGetIteratorOffset(mi), pkgKey);
- else {
-
- mlmp = NULL;
- oldMultiLibMask = 0;
- if (hge(oh, RPMTAG_MULTILIBMASK, NULL, (void **) &mlmp, NULL))
- oldMultiLibMask = *mlmp;
- mlmp = NULL;
- multiLibMask = 0;
- if (hge(h, RPMTAG_MULTILIBMASK, NULL, (void **) &mlmp, NULL))
- multiLibMask = *mlmp;
- if (oldMultiLibMask && multiLibMask
- && !(oldMultiLibMask & multiLibMask))
- {
- (void) rpmteSetMultiLib(p, multiLibMask);
- }
- }
- }
- mi = rpmdbFreeIterator(mi);
- }
-/*@=boundsread@*/
-
obsoletes = rpmdsLink(rpmteDS(p, RPMTAG_OBSOLETENAME), "Obsoletes");
obsoletes = rpmdsInit(obsoletes);
if (obsoletes != NULL)
if ((Name = rpmdsN(obsoletes)) == NULL)
continue; /* XXX can't happen */
+ /* Ignore colored obsoletes not in our rainbow. */
+ dscolor = rpmdsColor(obsoletes);
+ if (tscolor && dscolor && !(tscolor & dscolor))
+ continue;
+
/* XXX avoid self-obsoleting packages. */
if (!strcmp(rpmteN(p), Name))
continue;
* @param requires Requires: dependencies (or NULL)
* @param conflicts Conflicts: dependencies (or NULL)
* @param depName dependency name to filter (or NULL)
- * @param multiLib skip multilib colored dependencies?
+ * @param tscolor color bits for transaction set (0 disables)
* @param adding dependency is from added package set?
* @return 0 no problems found
*/
static int checkPackageDeps(rpmts ts, const char * pkgNEVR,
/*@null@*/ rpmds requires, /*@null@*/ rpmds conflicts,
- /*@null@*/ const char * depName, uint_32 multiLib, int adding)
+ /*@null@*/ const char * depName, uint_32 tscolor, int adding)
/*@globals rpmGlobalMacroContext,
fileSystem, internalState @*/
/*@modifies ts, requires, conflicts, rpmGlobalMacroContext,
fileSystem, internalState */
{
+ uint_32 dscolor;
const char * Name;
- int_32 Flags;
int rc;
int ourrc = 0;
if (depName != NULL && strcmp(depName, Name))
continue;
- Flags = rpmdsFlags(requires);
-
- /* If this requirement comes from the core package only, not libraries,
- then if we're installing the libraries only, don't count it in. */
- if (multiLib && !isDependsMULTILIB(Flags))
+ /* Ignore colored requires not in our rainbow. */
+ dscolor = rpmdsColor(requires);
+ if (tscolor && dscolor && !(tscolor & dscolor))
continue;
rc = unsatisfiedDepend(ts, requires, adding);
if (depName != NULL && strcmp(depName, Name))
continue;
- Flags = rpmdsFlags(conflicts);
-
- /* If this requirement comes from the core package only, not libraries,
- then if we're installing the libraries only, don't count it in. */
- if (multiLib && !isDependsMULTILIB(Flags))
+ /* Ignore colored conflicts not in our rainbow. */
+ dscolor = rpmdsColor(conflicts);
+ if (tscolor && dscolor && !(tscolor & dscolor))
continue;
rc = unsatisfiedDepend(ts, conflicts, adding);
int nrescans = 10;
int _printed = 0;
char deptypechar;
-#ifdef DYING
- int oType = TR_ADDED;
-#else
int oType = 0;
-#endif
int treex;
int depth;
int qlen;
/* Record all relations. */
rpmMessage(RPMMESS_DEBUG, _("========== recording tsort relations\n"));
pi = rpmtsiInit(ts);
- /* XXX Only added packages are ordered (for now). */
while ((p = rpmtsiNext(pi, oType)) != NULL) {
if ((requires = rpmteDS(p, RPMTAG_REQUIRENAME)) == NULL)
int rpmtsCheck(rpmts ts)
{
+ uint_32 tscolor = rpmtsColor(ts);
rpmdbMatchIterator mi = NULL;
rpmtsi pi = NULL; rpmte p;
int closeatexit = 0;
while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) {
rpmds provides;
- rpmMessage(RPMMESS_DEBUG, "========== +++ %s\n" , rpmteNEVR(p));
+ rpmMessage(RPMMESS_DEBUG, "========== +++ %s %s/%s 0x%x\n",
+ rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p));
rc = checkPackageDeps(ts, rpmteNEVR(p),
rpmteDS(p, RPMTAG_REQUIRENAME),
rpmteDS(p, RPMTAG_CONFLICTNAME),
NULL,
- rpmteMultiLib(p), 1);
+ tscolor, 1);
if (rc)
goto exit;
rpmds provides;
rpmfi fi;
- rpmMessage(RPMMESS_DEBUG, "========== --- %s\n" , rpmteNEVR(p));
+ rpmMessage(RPMMESS_DEBUG, "========== --- %s %s/%s 0x%x\n",
+ rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p));
#if defined(DYING) || defined(__LCLINT__)
/* XXX all packages now have Provides: name = version-release */
switch (fsm->action) {
case FA_SKIP:
break;
- case FA_SKIPMULTILIB: /* XXX RPMFILE_STATE_MULTILIB? */
- break;
case FA_UNKNOWN:
break;
fi->fstates[i] = RPMFILE_STATE_NETSHARED;
break;
+ case FA_SKIPCOLOR:
+ if (fi->fstates && rpmteType(fi->te) == TR_ADDED)
+ fi->fstates[i] = RPMFILE_STATE_WRONGCOLOR;
+ break;
+
case FA_BACKUP:
if (!(fsm->fflags & RPMFILE_GHOST)) /* XXX Don't if %ghost file. */
switch (rpmteType(fi->te)) {
case FA_ERASE: return "erase";
case FA_SKIPNSTATE: return "skipnstate";
case FA_SKIPNETSHARED: return "skipnetshared";
- case FA_SKIPMULTILIB: return "skipmultilib";
+ case FA_SKIPCOLOR: return "skipcolor";
default: return "???";
}
/*@notreached@*/
return 0;
}
+#ifdef DYING
/**
* Copy file data from h to newH.
* @param fi transaction element file info
fileSize = *fileSizes;
xx = hge(newH, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, &count);
for (i = 0, fc = 0; i < count; i++)
- if (actions[i] != FA_SKIPMULTILIB) {
+ if (actions[i] != FA_SKIPCOLOR) {
fc++;
fileSize += fileSizes[i];
}
case RPM_INT8_TYPE:
newdata = xcalloc(fc, sizeof(int_8));
for (j = 0, k = 0; j < count; j++)
- if (actions[j] != FA_SKIPMULTILIB)
+ if (actions[j] != FA_SKIPCOLOR)
((int_8 *) newdata)[k++] = ((int_8 *) data)[j];
xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc);
free (newdata);
case RPM_INT16_TYPE:
newdata = xcalloc(fc, sizeof(int_16));
for (j = 0, k = 0; j < count; j++)
- if (actions[j] != FA_SKIPMULTILIB)
+ if (actions[j] != FA_SKIPCOLOR)
((int_16 *) newdata)[k++] = ((int_16 *) data)[j];
xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc);
free (newdata);
case RPM_INT32_TYPE:
newdata = xcalloc(fc, sizeof(int_32));
for (j = 0, k = 0; j < count; j++)
- if (actions[j] != FA_SKIPMULTILIB)
+ if (actions[j] != FA_SKIPCOLOR)
((int_32 *) newdata)[k++] = ((int_32 *) data)[j];
xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc);
free (newdata);
case RPM_STRING_ARRAY_TYPE:
newdata = xcalloc(fc, sizeof(char *));
for (j = 0, k = 0; j < count; j++)
- if (actions[j] != FA_SKIPMULTILIB)
+ if (actions[j] != FA_SKIPCOLOR)
((char **) newdata)[k++] = ((char **) data)[j];
xx = headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc);
free (newdata);
dirCount = dirNamesCount;
newdata = xcalloc(fc, sizeof(*newDirIndexes));
for (i = 0, k = 0; i < count; i++) {
- if (actions[i] == FA_SKIPMULTILIB)
+ if (actions[i] == FA_SKIPCOLOR)
continue;
for (j = 0; j < dirCount; j++)
if (!strcmp(dirNames[j], newDirNames[newDirIndexes[i]]))
}
}
for (j = 0, k = 0; j < newCount; j++) {
+#ifdef DYING
if (!newNames[j] || !isDependsMULTILIB(newFlags[j]))
+#else
+ if (!newNames[j])
+#endif
/*@innercontinue@*/ continue;
if (j != k) {
newNames[k] = newNames[j];
return RPMRC_OK;
}
/*@=boundswrite@*/
+#endif
/**
* Mark files in database shared with this package as "replaced".
const rpmts ts = psm->ts;
rpmfi fi = psm->fi;
HGE_t hge = fi->hge;
+#ifdef DYING
HME_t hme = fi->hme;
+#endif
HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData);
rpmRC rc = psm->rc;
int saveerrno;
while ((psm->oh = rpmdbNextIterator(psm->mi))) {
fi->record = rpmdbGetIteratorOffset(psm->mi);
+#ifdef DYING
if (rpmtsFlags(ts) & RPMTRANS_FLAG_MULTILIB)
psm->oh = headerCopy(psm->oh);
else
+#endif
psm->oh = NULL;
/*@loopbreak@*/ break;
}
xx = headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE,
&installTime, 1);
+#ifdef DYING
if (rpmtsFlags(ts) & RPMTRANS_FLAG_MULTILIB) {
uint_32 multiLib, * newMultiLib, * p;
rc = mergeFiles(fi, psm->oh, fi->h);
if (rc) break;
}
-
+#endif
/*
* If this package has already been installed, remove it from
case RPMFILE_STATE_NETSHARED:
te = stpcpy(te, _("net shared "));
/*@switchbreak@*/ break;
+ case RPMFILE_STATE_WRONGCOLOR:
+ te = stpcpy(te, _("wrong color "));
+ /*@switchbreak@*/ break;
case RPMFILE_STATE_MISSING:
te = stpcpy(te, _("(no state) "));
/*@switchbreak@*/ break;
/*@refcounted@*/ /*@null@*/
rpmfi fi; /*!< File info set. */
-#ifdef DYING
- uint_32 multiLib; /* MULTILIB */
-#endif
+ uint_32 tscolor; /*!< Transaction color bits. */
/*@exposed@*/ /*@dependent@*/ /*@null@*/
fnpyKey key; /*!< Associated file name/python object */
const char * baseName; /*!< File basename. */
int baseNameLen;
alNum pkgNum; /*!< Containing package index. */
- int fileFlags; /* MULTILIB */
+ uint_32 ficolor;
};
typedef /*@abstract@*/ struct dirInfo_s * dirInfo;
int delta; /*!< Delta for pkg list reallocation. */
int size; /*!< No. of pkgs in list. */
int alloced; /*!< No. of pkgs allocated for list. */
+ uint_32 tscolor; /*!< Transaction color. */
int numDirs; /*!< No. of directories. */
/*@owned@*/ /*@null@*/
dirInfo dirs; /*!< Set of directories. */
/*@-bounds@*/
alKey rpmalAdd(rpmal * alistp, alKey pkgKey, fnpyKey key,
- rpmds provides, rpmfi fi)
+ rpmds provides, rpmfi fi, uint_32 tscolor)
{
alNum pkgNum;
rpmal al;
alp = al->list + pkgNum;
alp->key = key;
+ alp->tscolor = tscolor;
/*@-modfilesys@*/
if (_rpmal_debug)
-fprintf(stderr, "*** add %p[%d]\n", al->list, pkgNum);
+fprintf(stderr, "*** add %p[%d] 0x%x\n", al->list, pkgNum, tscolor);
/*@=modfilesys@*/
alp->provides = rpmdsLink(provides, "Provides (rpmalAdd)");
/*@=assignexpose =dependenttrans =observertrans @*/
fie->baseNameLen = (fie->baseName ? strlen(fie->baseName) : 0);
fie->pkgNum = pkgNum;
- fie->fileFlags = rpmfiFFlags(fi);
+ fie->ficolor = rpmfiFColor(fi);
die->numFiles++;
fie++;
}
return strcmp(a->entry, b->entry);
}
-void rpmalAddProvides(rpmal al, alKey pkgKey, rpmds provides)
+void rpmalAddProvides(rpmal al, alKey pkgKey, rpmds provides, uint_32 tscolor)
{
+ uint_32 dscolor;
+ const char * Name;
alNum pkgNum = alKey2Num(al, pkgKey);
availableIndex ai = &al->index;
availableIndexEntry aie;
if (rpmdsInit(provides) != NULL)
while (rpmdsNext(provides) >= 0) {
- const char * Name;
-
-#ifdef DYING /* XXX FIXME: multilib colored dependency search */
- const int_32 Flags = rpmdsFlags(provides);
-
- /* If multilib install, skip non-multilib provides. */
- if (al->list[i].multiLib && !isDependsMULTILIB(Flags)) {
- ai->size--;
- /*@innercontinue@*/ continue;
- }
-#endif
if ((Name = rpmdsN(provides)) == NULL)
continue; /* XXX can't happen */
+ /* Ignore colored provides not in our rainbow. */
+ dscolor = rpmdsColor(provides);
+ if (tscolor && dscolor && !(tscolor & dscolor))
+ continue;
+
aie = ai->index + ai->k;
ai->k++;
for (i = 0; i < al->size; i++) {
alp = al->list + i;
- rpmalAddProvides(al, (alKey)i, alp->provides);
+ rpmalAddProvides(al, (alKey)i, alp->provides, alp->tscolor);
}
qsort(ai->index, ai->size, sizeof(*ai->index), indexcmp);
}
fnpyKey *
rpmalAllFileSatisfiesDepend(const rpmal al, const rpmds ds, alKey * keyp)
{
+ uint_32 tscolor;
+ uint_32 ficolor;
int found = 0;
const char * dirName;
const char * baseName;
fprintf(stderr, "==> fie %p %s\n", fie, (fie->baseName ? fie->baseName : "(nil)"));
/*@=modfilesys@*/
-#ifdef DYING /* XXX FIXME: multilib colored dependency search */
- /*
- * If a file dependency would be satisfied by a file
- * we are not going to install, skip it.
- */
- if (al->list[fie->pkgNum].multiLib && !isFileMULTILIB(fie->fileFlags))
- continue;
-#endif
+ alp = al->list + fie->pkgNum;
+
+ /* Ignore colored files not in our rainbow. */
+ tscolor = alp->tscolor;
+ ficolor = fie->ficolor;
+ if (tscolor && ficolor && !(tscolor & ficolor))
+ continue;
rpmdsNotify(ds, _("(added files)"), 0);
- alp = al->list + fie->pkgNum;
ret = xrealloc(ret, (found+2) * sizeof(*ret));
if (ret) /* can't happen */
ret[found] = alp->key;
* @param key associated file name/python object
* @param provides provides dependency set
* @param fi file info set
+ * @param tscolor transaction color bits
* @return available package index
*/
alKey rpmalAdd(rpmal * alistp,
/*@dependent@*/ /*@null@*/ alKey pkgKey,
/*@dependent@*/ /*@null@*/ fnpyKey key,
- /*@null@*/ rpmds provides, /*@null@*/ rpmfi fi)
+ /*@null@*/ rpmds provides, /*@null@*/ rpmfi fi,
+ uint_32 tscolor)
/*@globals fileSystem @*/
/*@modifies *alistp, provides, fi, fileSystem @*/;
* @param al available list
* @param pkgKey package key
* @param provides added package provides
+ * @param tscolor transaction color bits
*/
/*@-exportlocal@*/
void rpmalAddProvides(rpmal al,
/*@dependent@*/ /*@null@*/ alKey pkgKey,
- /*@null@*/ rpmds provides)
+ /*@null@*/ rpmds provides, uint_32 tscolor)
/*@modifies al, provides @*/;
/*@=exportlocal@*/
return onopromote;
}
-int_32 rpmdsColor(const rpmds ds)
+uint_32 rpmdsColor(const rpmds ds)
{
- int_32 Color = 0;
+ uint_32 Color = 0;
if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
/*@-boundsread@*/
return Color;
}
-int_32 rpmdsSetColor(const rpmds ds, int_32 color)
+uint_32 rpmdsSetColor(const rpmds ds, uint_32 color)
{
- int_32 ocolor = 0;
+ uint_32 ocolor = 0;
if (ds != NULL && ds->i >= 0 && ds->i < ds->Count) {
/*@-bounds@*/
/*@only@*/ /*@null@*/
int_32 * Flags; /*!< Bit(s) identifying context/comparison. */
/*@only@*/ /*@null@*/
- int_32 * Color; /*!< Bit(s) calculated from file color(s). */
+ uint_32 * Color; /*!< Bit(s) calculated from file color(s). */
/*@only@*/ /*@null@*/
int_32 * Refs; /*!< No. of file refs. */
rpmTag tagN; /*!< Header tag. */
* @param ds dependency set
* @return current dependency color
*/
-int_32 rpmdsColor(/*@null@*/ const rpmds ds)
+uint_32 rpmdsColor(/*@null@*/ const rpmds ds)
/*@*/;
/**
* @param color new dependency color
* @return previous dependency color
*/
-int_32 rpmdsSetColor(/*@null@*/ const rpmds ds, int_32 color)
+uint_32 rpmdsSetColor(/*@null@*/ const rpmds ds, uint_32 color)
/*@modifies ds @*/;
/**
if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) {
/*@-boundsread@*/
if (fi->fcolors != NULL)
- fcolor = fi->fcolors[fi->i];
+ /* XXX ignore all but lsnibble for now. */
+ fcolor = (fi->fcolors[fi->i] & 0x0f);
/*@=boundsread@*/
}
return fcolor;
fileTypes ft;
int fnlen;
+#ifdef DYING
/*
* If only adding libraries of different arch into an already
* installed package, skip all other files.
*/
- if (rpmteMultiLib(p) && !isFileMULTILIB((fFlags[i]))) {
+ if (rpmteColor(p) && !isFileMULTILIB((fFlags[i]))) {
if (actions) {
actions[i] = FA_SKIPMULTILIB;
rpmMessage(RPMMESS_DEBUG, _("excluding multilib path %s%s\n"),
}
continue;
}
+#endif
len = reldel +
strlen(dirNames[dirIndexes[i]]) + strlen(baseNames[i]) + 1;
RPMFILE_STATE_NORMAL = 0,
RPMFILE_STATE_REPLACED = 1,
RPMFILE_STATE_NOTINSTALLED = 2,
- RPMFILE_STATE_NETSHARED = 3
+ RPMFILE_STATE_NETSHARED = 3,
+ RPMFILE_STATE_WRONGCOLOR = 4
} rpmfileState;
#define RPMFILE_STATE_MISSING -1 /* XXX used for unavailable data */
FA_ERASE, /*!< ... to be removed. */
FA_SKIPNSTATE, /*!< ... untouched, state "not installed". */
FA_SKIPNETSHARED, /*!< ... untouched, state "netshared". */
- FA_SKIPMULTILIB /*!< ... untouched. @todo state "multilib" ???. */
+ FA_SKIPCOLOR /*!< ... untouched, state "wrong color". */
} fileAction;
#define XFA_SKIPPING(_a) \
- ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPMULTILIB)
+ ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)
/**
* File types.
rpmteColorDS(p, RPMTAG_PROVIDENAME);
rpmteColorDS(p, RPMTAG_REQUIRENAME);
-
- p->multiLib = 0;
}
/*@=bounds@*/
return (te != NULL ? te->os : NULL);
}
-int rpmteMultiLib(rpmte te)
+uint_32 rpmteColor(rpmte te)
{
- return (te != NULL ? te->multiLib : 0);
+ return (te != NULL ? te->color : 0);
}
-int rpmteSetMultiLib(rpmte te, int nmultiLib)
+uint_32 rpmteSetColor(rpmte te, uint_32 color)
{
- int omultiLib = 0;
+ int ocolor = 0;
if (te != NULL) {
- omultiLib = te->multiLib;
- te->multiLib = nmultiLib;
+ ocolor = te->color;
+ te->color = color;
}
- return omultiLib;
+ return ocolor;
}
int rpmteDepth(rpmte te)
fi = rpmfiInit(fi, 0);
if (fi != NULL)
while (rpmfiNext(fi) >= 0) {
- /* XXX ignore all but lsnibble for now. */
- val = (rpmfiFColor(fi) & 0x0f);
+ val = rpmfiFColor(fi);
ddict = NULL;
ndx = rpmfiFDepends(fi, &ddict);
if (ddict != NULL)
ds = rpmdsInit(ds);
while ((i = rpmdsNext(ds)) >= 0) {
val = colors[i];
+ te->color |= val;
(void) rpmdsSetColor(ds, val);
val = refs[i];
if (val >= 0)
/*@refcounted@*/ /*@null@*/
rpmfi fi; /*!< File information. */
- uint_32 multiLib; /*!< (TR_ADDED) MULTILIB */
+ uint_32 color; /*!< Bit(s) from package dependencies */
/*@exposed@*/ /*@dependent@*/ /*@null@*/
fnpyKey key; /*!< (TR_ADDED) Retrieval key. */
/*@*/;
/**
- * Retrieve multlib flags of transaction element.
+ * Retrieve color bits of transaction element.
* @param te transaction element
- * @return multilib flags
+ * @return color bits
*/
-int rpmteMultiLib(rpmte te)
+uint_32 rpmteColor(rpmte te)
/*@*/;
/**
- * Set multlib flags of transaction element.
+ * Set color bits of transaction element.
* @param te transaction element
- * @param nmultiLib new multilib flags
- * @return previous multilib flags
+ * @param color new color bits
+ * @return previous color bits
*/
-int rpmteSetMultiLib(rpmte te, int nmultiLib)
+uint_32 rpmteSetColor(rpmte te, uint_32 color)
/*@modifies te @*/;
/**
return orelocateElement;
}
+uint_32 rpmtsColor(rpmts ts)
+{
+ return (ts != NULL ? ts->color : 0);
+}
+
+uint_32 rpmtsSetColor(rpmts ts, uint_32 color)
+{
+ uint_32 ocolor = 0;
+ if (ts != NULL) {
+ ocolor = ts->color;
+ ts->color = color;
+ }
+ return ocolor;
+}
+
int rpmtsSetNotifyCallback(rpmts ts,
rpmCallbackFunction notify, rpmCallbackData notifyData)
{
ts->tid = (int_32) time(NULL);
ts->delta = 5;
+ ts->color = rpmExpandNumeric("%{?_transaction_color}");
+
ts->numRemovedPackages = 0;
ts->allocedRemovedPackages = ts->delta;
ts->removedPackages = xcalloc(ts->allocedRemovedPackages,
int delta; /*!< Delta for reallocation. */
int_32 tid; /*!< Transaction id. */
+ uint_32 color; /*!< Transaction color bits. */
+
rpmVSFlags vsflags; /*!< Signature/digest verification flags. */
/*@observer@*/ /*@dependent@*/ /*@null@*/
rpmte rpmtsSetRelocateElement(rpmts ts, /*@null@*/ rpmte relocateElement)
/*@modifies ts @*/;
+/**
+ * Retrieve color bits of transaction set.
+ * @param ts transaction set
+ * @return color bits
+ */
+uint_32 rpmtsColor(rpmts ts)
+ /*@*/;
+
+/**
+ * Set color bits of transaction set.
+ * @param ts transaction set
+ * @param color new color bits
+ * @return previous color bits
+ */
+uint_32 rpmtsSetColor(rpmts ts, uint_32 color)
+ /*@modifies ts @*/;
+
/** \ingroup rpmts
* Set transaction notify callback function and argument.
*
/*@globals rpmGlobalMacroContext @*/
/*@modifies fi, rpmGlobalMacroContext @*/
{
+ uint_32 tscolor = rpmtsColor(ts);
+ uint_32 ficolor;
int noConfigs = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONFIGS);
int noDocs = (rpmtsFlags(ts) & RPMTRANS_FLAG_NODOCS);
char ** netsharedPaths = NULL;
if (fi != NULL) /* XXX lclint */
while ((i = rpmfiNext(fi)) >= 0)
{
- char **nsp;
+ char ** nsp;
bn = rpmfiBN(fi);
bnlen = strlen(bn);
/* Don't bother with skipped files */
if (XFA_SKIPPING(fi->actions[i])) {
- drc[ix]--;
+ drc[ix]--; dff[ix] = 1;
continue;
}
+ /* Ignore colored files not in our rainbow. */
+ ficolor = rpmfiFColor(fi);
+ if (tscolor && ficolor && !(tscolor & ficolor)) {
+ drc[ix]--; dff[ix] = 1;
+ fi->actions[i] = FA_SKIPCOLOR;
+ continue;
+ }
+
/*
* Skip net shared paths.
* Net shared paths are not relative to the current root (though
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
{
+ uint_32 tscolor = rpmtsColor(ts);
int i, j;
int ourrc = 0;
int totalFileCount = 0;
continue; /* XXX can't happen */
fc = rpmfiFC(fi);
- if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_IGNOREARCH))
+ if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_IGNOREARCH) && !tscolor)
if (!archOkay(rpmteA(p)))
rpmpsAppend(ps, RPMPROB_BADARCH,
rpmteNEVR(p), rpmteKey(p),
mi = rpmdbFreeIterator(mi);
}
+#ifdef DYING
/* XXX multilib should not display "already installed" problems */
- if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACEPKG) && !rpmteMultiLib(p)) {
+ if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACEPKG) && !rpmteColor(p))
+#else
+ if (!(rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACEPKG) && !tscolor)
+#endif
+ {
mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(p), 0);
xx = rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_DEFAULT,
rpmteE(p));
}
psm->fi = rpmfiLink(p->fi, NULL);
- if (rpmteMultiLib(p))
+#ifdef DYING
+ if (rpmteColor(p))
(void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_MULTILIB));
else
+#endif
(void) rpmtsSetFlags(ts, (rpmtsFlags(ts) & ~RPMTRANS_FLAG_MULTILIB));
/*@-nullstate@*/ /* FIX: psm->fi may be NULL */
case RPMFILE_STATE_NETSHARED:
case RPMFILE_STATE_REPLACED:
case RPMFILE_STATE_NOTINSTALLED:
+ case RPMFILE_STATE_WRONGCOLOR:
return 0;
/*@notreached@*/ break;
case RPMFILE_STATE_NORMAL:
return NULL;
/* XXX errors */
- pkgKey = rpmalAdd(&s->al, pkgKey, key, dso->ds, fio->fi);
+ /* XXX transaction colors */
+ pkgKey = rpmalAdd(&s->al, pkgKey, key, dso->ds, fio->fi, 0);
return Py_BuildValue("i", pkgKey);
}
if (!PyArg_ParseTuple(args, "iOO!O!:AddProvides", &pkgKey, &rpmds_Type, &dso))
return NULL;
- rpmalAddProvides(s->al, pkgKey, dso->ds);
+ /* XXX transaction colors */
+ rpmalAddProvides(s->al, pkgKey, dso->ds, 0);
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
-rpmte_MultiLib(rpmteObject * s, PyObject * args)
+rpmte_Color(rpmteObject * s, PyObject * args)
/*@*/
{
- if (!PyArg_ParseTuple(args, ":MultiLib")) return NULL;
- return Py_BuildValue("i", rpmteMultiLib(s->te));
+ if (!PyArg_ParseTuple(args, ":Color")) return NULL;
+ return Py_BuildValue("i", rpmteColor(s->te));
}
static PyObject *
{"NEVR", (PyCFunction)rpmte_NEVR, METH_VARARGS,
"te.NEVR() -> NEVR\n\
- Return element name-version-release.\n" },
- {"MultiLib",(PyCFunction)rpmte_MultiLib, METH_VARARGS,
+ {"Color",(PyCFunction)rpmte_Color, METH_VARARGS,
NULL},
{"Depth", (PyCFunction)rpmte_Depth, METH_VARARGS,
NULL},
/* XXX FIXME: return code RPMAL_NOMATCH is error */
(void) rpmalAdd(&ts->availablePackages, RPMAL_NOMATCH, key,
- provides, fi);
+ provides, fi, rpmtsColor(ts));
fi = rpmfiFree(fi);
provides = rpmdsFree(provides);
/** \ingroup python
*/
static PyObject *
+rpmts_SetColor(rpmtsObject * s, PyObject * args)
+ /*@modifies s @*/
+{
+ uint_32 tscolor;
+
+if (_rpmts_debug)
+fprintf(stderr, "*** rpmts_SetColor(%p) ts %p\n", s, s->ts);
+
+ if (!PyArg_ParseTuple(args, "i:Color", &tscolor)) return NULL;
+
+ /* XXX FIXME: value check on tscolor. */
+
+ return Py_BuildValue("i", rpmtsSetColor(s->ts, tscolor));
+}
+
+/** \ingroup python
+ */
+static PyObject *
rpmts_PgpPrtPkts(rpmtsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
/*@modifies _Py_NoneStruct @*/
rpm.RPMVSF_NORSA if set, don't check header+payload RSA signature\n\
rpm._RPMVSF_NODIGESTS if set, don't check digest(s)\n\
rpm._RPMVSF_NOSIGNATURES if set, don't check signature(s)\n" },
+ {"setColor",(PyCFunction) rpmts_SetColor, METH_VARARGS,
+ NULL },
{"pgpPrtPkts", (PyCFunction) rpmts_PgpPrtPkts, METH_VARARGS,
NULL },
{"pgpImportPubkey", (PyCFunction) rpmts_PgpImportPubkey, METH_VARARGS,
%define version @VERSION@
Version: %{version}
%{expand: %%define rpm_version %{version}}
-Release: 0.46
+Release: 0.48
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz
Copyright: GPL
rpm alias --fileclass --qf '[%{FILENAMES}\t%{FILECLASS}\n]' \
--POPTdesc=$"list file names with classes"
-rpm alias --filecolor --qf '[%{FILENAMES}\t%{FILECOLOR}\n]' \
+rpm alias --filecolor --qf '[%{FILENAMES}\t%{FILECOLORS}\n]' \
--POPTdesc=$"list file names with colors"
rpm alias --fileprovide --qf '[%{FILENAMES}\t%{FILEPROVIDE}\n]' \
rpmq alias --fileclass --qf '[%{FILENAMES}\t%{FILECLASS}\n]' \
--POPTdesc=$"list file names with classes"
-rpmq alias --filecolor --qf '[%{FILENAMES}\t%{FILECOLOR}\n]' \
+rpmq alias --filecolor --qf '[%{FILENAMES}\t%{FILECOLORS}\n]' \
--POPTdesc=$"list file names with colors"
rpmq alias --fileprovide --qf '[%{FILENAMES}\t%{FILEPROVIDE}\n]' \
rpmquery alias --fileclass --qf '[%{FILENAMES}\t%{FILECLASS}\n]' \
--POPTdesc=$"list file names with classes"
-rpmquery alias --filecolor --qf '[%{FILENAMES}\t%{FILECOLOR}\n]' \
+rpmquery alias --filecolor --qf '[%{FILENAMES}\t%{FILECOLORS}\n]' \
--POPTdesc=$"list file names with colors"
rpmquery alias --fileprovide --qf '[%{FILENAMES}\t%{FILEPROVIDE}\n]' \