free(refs);
}
-int rpmtsiOc(rpmtsi tsi)
-{
- return tsi->ocsave;
-}
-
rpmtsi rpmtsiFree(rpmtsi tsi)
{
/* XXX watchout: a funky recursion segfaults here iff nrefs is wrong. */
tsi = xcalloc(1, sizeof(*tsi));
tsi->ts = rpmtsLink(ts, RPMDBG_M("rpmtsi"));
tsi->oc = 0;
- tsi->ocsave = tsi->oc;
return tsi;
}
return te;
if (tsi->oc < rpmtsNElements(tsi->ts)) oc = tsi->oc++;
- tsi->ocsave = oc;
if (oc != -1)
te = rpmtsElement(tsi->ts, oc);
return te;
void rpmteColorDS(rpmte te, rpmTag tag);
/** \ingroup rpmte
- * Return transaction element index.
- * @param tsi transaction element iterator
- * @return transaction element index
- */
-int rpmtsiOc(rpmtsi tsi);
-
-/** \ingroup rpmte
* Destroy transaction element iterator.
* @param tsi transaction element iterator
* @return NULL always
*/
struct rpmtsi_s {
rpmts ts; /*!< transaction set. */
- int ocsave; /*!< last returned iterator index. */
int oc; /*!< iterator index. */
};
rpmfi fi;
rpmdbMatchIterator mi;
int xx;
+ int oc = 0;
const char * baseName;
rpmStringSet baseNames = rpmStringSetCreate(fileCount,
while ((p = rpmtsiNext(pi, 0)) != NULL) {
(void) rpmdbCheckSignals();
- if ((fi = rpmteFI(p)) == NULL)
- continue; /* XXX can't happen */
- rpmtsNotify(ts, NULL, RPMCALLBACK_TRANS_PROGRESS, rpmtsiOc(pi),
- ts->orderCount);
+ rpmtsNotify(ts, NULL, RPMCALLBACK_TRANS_PROGRESS, oc++, ts->orderCount);
/* Gather all installed headers with matching basename's. */
- fi = rpmfiInit(fi, 0);
+ fi = rpmfiInit(rpmteFI(p), 0);
while (rpmfiNext(fi) >= 0) {
size_t keylen;
baseName = rpmfiBN(fi);