From fe5e906ab2cfe9ed82ba7fa63277d5ce41451b87 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 19 Dec 2008 14:57:37 +0200 Subject: Eliminate file info set argument to rpmpsmNew() - ts element carries the info already, no need for separate argument --- lib/psm.c | 14 +++++++++----- lib/psm.h | 3 +-- lib/transaction.c | 5 ++--- lib/verify.c | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/psm.c b/lib/psm.c index 22bf74fcb..8c1d130ec 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -317,6 +317,8 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, goto exit; } fi->apath = filenames.data; /* Ick */ + rpmteSetFI(te, fi); + fi = rpmfiFree(fi); if (rpmMkdirs(rpmtsRootDir(ts), "%{_topdir}:%{_sourcedir}:%{_specdir}")) { goto exit; @@ -330,7 +332,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, for (i=0; igoal = PSM_PKGINSTALL; /* FIX: psm->fi->dnl should be owned. */ @@ -1121,17 +1123,19 @@ rpmRC rpmpsmScriptStage(rpmpsm psm, rpmTag scriptTag, rpmTag progTag) return rpmpsmStage(psm, PSM_SCRIPT); } -rpmpsm rpmpsmNew(rpmts ts, rpmte te, rpmfi fi) +rpmpsm rpmpsmNew(rpmts ts, rpmte te) { rpmpsm psm = xcalloc(1, sizeof(*psm)); if (ts) psm->ts = rpmtsLink(ts, RPMDBG_M("rpmpsmNew")); + if (te) { #ifdef NOTYET - if (te) psm->te = rpmteLink(te, RPMDBG_M("rpmpsmNew")); + psm->te = rpmteLink(te, RPMDBG_M("rpmpsmNew"));  #else - if (te) psm->te = te; + psm->te = te; #endif - if (fi) psm->fi = rpmfiLink(fi, RPMDBG_M("rpmpsmNew")); + psm->fi = rpmfiLink(rpmteFI(te), RPMDBG_M("rpmpsmNew")); + } return rpmpsmLink(psm, RPMDBG_M("rpmpsmNew")); } diff --git a/lib/psm.h b/lib/psm.h index 13e081cc9..123375df1 100644 --- a/lib/psm.h +++ b/lib/psm.h @@ -93,11 +93,10 @@ rpmpsm rpmpsmFree(rpmpsm psm); * Create and load a package state machine. * @param ts transaction set * @param te transaction set element - * @param fi file info set * @return new package state machine */ RPM_GNUC_INTERNAL -rpmpsm rpmpsmNew(rpmts ts, rpmte te, rpmfi fi); +rpmpsm rpmpsmNew(rpmts ts, rpmte te); /** * Package state machine driver. diff --git a/lib/transaction.c b/lib/transaction.c index b39caade3..e5a524982 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -828,7 +828,7 @@ static int runTransScripts(rpmts ts, rpmTag stag) } if (rpmteOpen(p, ts, 0)) { - psm = rpmpsmNew(ts, p, NULL); + psm = rpmpsmNew(ts, p); xx = rpmpsmScriptStage(psm, stag, progtag); psm = rpmpsmFree(psm); rpmteClose(p, ts); @@ -865,7 +865,6 @@ static int rpmtsProcess(rpmts ts) if (rpmteOpen(p, ts, 1)) { rpmpsm psm = NULL; - rpmfi fi = rpmteFI(p); pkgStage stage = PSM_UNKNOWN; int async = (rpmtsiOc(pi) >= rpmtsUnorderedSuccessors(ts, -1)) ? 1 : 0; @@ -878,7 +877,7 @@ static int rpmtsProcess(rpmts ts) stage = PSM_PKGERASE; break; } - psm = rpmpsmNew(ts, p, fi); + psm = rpmpsmNew(ts, p); rpmpsmSetAsync(psm, async); (void) rpmswEnter(rpmtsOp(ts, op), 0); diff --git a/lib/verify.c b/lib/verify.c index e96bfaa36..1fb0195d8 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -278,7 +278,7 @@ static int rpmVerifyScript(QVA_t qva, rpmts ts, Header h, FD_t scriptFd) rpmtsSetScriptFd(ts, scriptFd); /* create psm to run the script */ - psm = rpmpsmNew(ts, te, NULL); + psm = rpmpsmNew(ts, te); rpmpsmScriptStage(psm, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG); rc = rpmpsmStage(psm, PSM_SCRIPT); psm = rpmpsmFree(psm); -- cgit v1.2.3