- avoids having to muck with te internals here and there...
return h;
}
-int rpmteOpen(rpmte te, rpmts ts)
+int rpmteOpen(rpmte te, rpmts ts, int reload_fi)
{
Header h = NULL;
unsigned int instance;
break;
}
if (h != NULL) {
+ if (reload_fi) {
+ rpmte savep = rpmtsSetRelocateElement(ts, te);
+ rpmfi fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER);
+ (void) rpmtsSetRelocateElement(ts, savep);
+ rpmteSetFI(te, fi);
+ rpmfiFree(fi);
+ }
+
rpmteSetHeader(te, h);
headerFree(h);
}
break;
}
rpmteSetHeader(te, NULL);
+ rpmteSetFI(te, NULL);
return 1;
}
rpmfi rpmteSetFI(rpmte te, rpmfi fi);
RPM_GNUC_INTERNAL
-int rpmteOpen(rpmte te, rpmts ts);
+int rpmteOpen(rpmte te, rpmts ts, int reload_fi);
RPM_GNUC_INTERNAL
int rpmteClose(rpmte te, rpmts ts);
break;
}
- if (rpmteOpen(p, ts)) {
+ if (rpmteOpen(p, ts, 0)) {
psm = rpmpsmNew(ts, p, NULL);
xx = rpmpsmScriptStage(psm, stag, progtag);
psm = rpmpsmFree(psm);
continue;
}
- if (rpmteOpen(p, ts)) {
+ if (rpmteOpen(p, ts, 1)) {
rpmpsm psm = NULL;
- rpmfi fi = NULL;
+ rpmfi fi = rpmteFI(p);
pkgStage stage = PSM_UNKNOWN;
int async = (rpmtsiOc(pi) >= rpmtsUnorderedSuccessors(ts, -1)) ?
1 : 0;
- rpmte savep;
-
- savep = rpmtsSetRelocateElement(ts, p);
- fi = p->fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER);
- (void) rpmtsSetRelocateElement(ts, savep);
switch (tetype) {
case TR_ADDED:
(void) rpmswExit(rpmtsOp(ts, op), 0);
psm = rpmpsmFree(psm);
rpmteClose(p, ts);
- p->fi = rpmfiFree(p->fi);
}
if (failed) {
rpmteMarkFailed(p, ts);
/* fake up a erasure transaction element */
rc = rpmtsAddEraseElement(ts, h, -1);
te = rpmtsElement(ts, 0);
- rpmteOpen(te, ts);
+ rpmteOpen(te, ts, 0);
if (scriptFd != NULL)
rpmtsSetScriptFd(ts, scriptFd);