summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-12-17 16:17:45 +0200
committerPanu Matilainen <pmatilai@redhat.com>2009-12-17 16:17:45 +0200
commit640db40ac593a2d30f556e277164e980508ee9ef (patch)
tree46bf9d88f5ff9485fb07df6ea2d8eb14fadbcba7 /lib
parentc2e1c048b3341824f9f0e50f2c9e2d8598891f9e (diff)
downloadrpm-640db40ac593a2d30f556e277164e980508ee9ef.tar.gz
rpm-640db40ac593a2d30f556e277164e980508ee9ef.tar.bz2
rpm-640db40ac593a2d30f556e277164e980508ee9ef.zip
Eliminate unnecessary ts ping-pong inside rpmte
- rpmteNew() and the stuff it calls doesn't need the transaction set for anything since a long time - document ts argument to be unused
Diffstat (limited to 'lib')
-rw-r--r--lib/rpmte.c19
-rw-r--r--lib/rpmte.h2
2 files changed, 9 insertions, 12 deletions
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 1684aa2f0..edf1e5439 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -119,7 +119,7 @@ static void delTE(rpmte p)
return;
}
-static rpmfi getFI(rpmte p, rpmts ts, Header h)
+static rpmfi getFI(rpmte p, Header h)
{
rpmfiFlags fiflags;
fiflags = (p->type == TR_ADDED) ? (RPMFI_NOHEADER | RPMFI_FLAGS_INSTALL) :
@@ -131,7 +131,7 @@ static rpmfi getFI(rpmte p, rpmts ts, Header h)
rpmRelocateFileList(p->relocs, p->nrelocs, p->fs, h);
}
}
- return rpmfiNew(ts, h, RPMTAG_BASENAMES, fiflags);
+ return rpmfiNew(NULL, h, RPMTAG_BASENAMES, fiflags);
}
/* stupid bubble sort, but it's probably faster here */
@@ -154,7 +154,7 @@ static void sortRelocs(rpmRelocation *relocations, int numRelocations)
}
}
-static void buildRelocs(rpmts ts, rpmte p, Header h, rpmRelocation *relocs)
+static void buildRelocs(rpmte p, Header h, rpmRelocation *relocs)
{
int i;
struct rpmtd_s validRelocs;
@@ -223,15 +223,12 @@ static void buildRelocs(rpmts ts, rpmte p, Header h, rpmRelocation *relocs)
/**
* Initialize transaction element data from header.
- * @param ts transaction set
* @param p transaction element
* @param h header
* @param key (TR_ADDED) package retrieval key (e.g. file name)
* @param relocs (TR_ADDED) package file relocations
*/
-static void addTE(rpmts ts, rpmte p, Header h,
- fnpyKey key,
- rpmRelocation * relocs)
+static void addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs)
{
p->name = headerGetAsString(h, RPMTAG_NAME);
p->version = headerGetAsString(h, RPMTAG_VERSION);
@@ -253,7 +250,7 @@ static void addTE(rpmts ts, rpmte p, Header h,
p->nrelocs = 0;
p->relocs = NULL;
if (relocs != NULL)
- buildRelocs(ts, p, h, relocs);
+ buildRelocs(p, h, relocs);
p->db_instance = headerGetInstance(h);
p->key = key;
@@ -276,7 +273,7 @@ static void addTE(rpmts ts, rpmte p, Header h,
rpmtdFreeData(&bnames);
}
- p->fi = getFI(p, ts, h);
+ p->fi = getFI(p, h);
/* See if we have pre/posttrans scripts. */
p->transscripts |= (headerIsEntry(h, RPMTAG_PRETRANS) &&
@@ -309,7 +306,7 @@ rpmte rpmteNew(const rpmts ts, Header h,
rpmte p = xcalloc(1, sizeof(*p));
p->type = type;
- addTE(ts, p, h, key, relocs);
+ addTE(p, h, key, relocs);
switch (type) {
case TR_ADDED:
p->pkgFileSize = headerGetNumber(h, RPMTAG_LONGSIGSIZE) + 96 + 256;
@@ -805,7 +802,7 @@ int rpmteOpen(rpmte te, rpmts ts, int reload_fi)
}
if (h != NULL) {
if (reload_fi) {
- te->fi = getFI(te, ts, h);
+ te->fi = getFI(te, h);
}
rpmteSetHeader(te, h);
diff --git a/lib/rpmte.h b/lib/rpmte.h
index a28fdde4c..bc1ffcda1 100644
--- a/lib/rpmte.h
+++ b/lib/rpmte.h
@@ -43,7 +43,7 @@ rpmte rpmteFree(rpmte te);
/** \ingroup rpmte
* Create a transaction element.
- * @param ts transaction set
+ * @param ts unused
* @param h header
* @param type TR_ADDED/TR_REMOVED
* @param key (TR_ADDED) package retrieval key (e.g. file name)