summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-12-19 14:57:37 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-12-19 14:57:37 +0200
commitfe5e906ab2cfe9ed82ba7fa63277d5ce41451b87 (patch)
tree73656c095f33c9e7998d3e75be0ef224565759f2
parentcbcff3bd99f11ad2e8ff8e37ebd32993f25d9a2f (diff)
downloadlibrpm-tizen-fe5e906ab2cfe9ed82ba7fa63277d5ce41451b87.tar.gz
librpm-tizen-fe5e906ab2cfe9ed82ba7fa63277d5ce41451b87.tar.bz2
librpm-tizen-fe5e906ab2cfe9ed82ba7fa63277d5ce41451b87.zip
Eliminate file info set argument to rpmpsmNew()
- ts element carries the info already, no need for separate argument
-rw-r--r--lib/psm.c14
-rw-r--r--lib/psm.h3
-rw-r--r--lib/transaction.c5
-rw-r--r--lib/verify.c2
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; i<fc; i++) rpmfsSetAction(fs, i, FA_CREATE);
}
- psm = rpmpsmNew(ts, te, fi);
+ psm = rpmpsmNew(ts, te);
psm->goal = 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);