From: Florian Festi Date: Wed, 3 Dec 2008 09:59:05 +0000 (+0100) Subject: Kill rpmfiUpdateState and free all the rpmfis as soon as file conflict check is done X-Git-Tag: rpm-4.7.0-beta1~146 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e7b664e81b37be79d3dfdda4c7a72c4b7fdc760;p=platform%2Fupstream%2Frpm.git Kill rpmfiUpdateState and free all the rpmfis as soon as file conflict check is done --- diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 797e44d..4efd16a 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1421,20 +1421,6 @@ fprintf(stderr, "*** fi %p\t%s[%d]\n", fi, Type, (fi ? fi->fc : 0)); return rpmfiLink(fi, (fi ? fi->Type : NULL)); } -rpmfi rpmfiUpdateState(rpmfi fi, rpmts ts, rpmte p) -{ - rpmte savep; - - fi = rpmfiFree(fi); - - savep = rpmtsSetRelocateElement(ts, p); - fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER); - (void) rpmtsSetRelocateElement(ts, savep); - - p->fi = fi; - return fi; -} - void rpmfiSetFReplacedSize(rpmfi fi, rpm_loff_t newsize) { if (fi != NULL && fi->i >= 0 && fi->i < fi->fc) { diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h index 1a73fb7..62253e4 100644 --- a/lib/rpmfi_internal.h +++ b/lib/rpmfi_internal.h @@ -95,9 +95,6 @@ int nrefs; /*!< Reference count. */ }; RPM_GNUC_INTERNAL -rpmfi rpmfiUpdateState(rpmfi fi, rpmts ts, rpmte p); - -RPM_GNUC_INTERNAL void rpmfiSetFReplacedSize(rpmfi fi, rpm_loff_t newsize); RPM_GNUC_INTERNAL diff --git a/lib/transaction.c b/lib/transaction.c index cfdf589..5081bc0 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -869,15 +869,18 @@ static int rpmtsProcess(rpmts ts) 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: stage = PSM_PKGINSTALL; - fi = rpmfiUpdateState(rpmteFI(p), ts, p); break; case TR_REMOVED: stage = PSM_PKGERASE; - fi = rpmteFI(p); break; } psm = rpmpsmNew(ts, p, fi); @@ -888,6 +891,7 @@ static int rpmtsProcess(rpmts ts) (void) rpmswExit(rpmtsOp(ts, op), 0); psm = rpmpsmFree(psm); rpmteClose(p, ts); + p->fi = rpmfiFree(p->fi); } if (failed) { rpmteMarkFailed(p, ts); @@ -1233,6 +1237,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) if (rpmfiFC(fi) == 0) continue; fi->fps = _free(fi->fps); + p->fi = rpmfiFree(fi); } pi = rpmtsiFree(pi);