summaryrefslogtreecommitdiff
path: root/lib/rpmte.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-04-24 13:36:38 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-04-24 13:36:38 +0300
commit015a34e0df0f74006b48d76eae72cfdbe9121018 (patch)
tree7591eb2a15998e183b4d077fbc5a4e51a71184ce /lib/rpmte.c
parent9f4186766c7c628b8cc67fe0c62d58cf38b51c92 (diff)
downloadrpm-015a34e0df0f74006b48d76eae72cfdbe9121018.tar.gz
rpm-015a34e0df0f74006b48d76eae72cfdbe9121018.tar.bz2
rpm-015a34e0df0f74006b48d76eae72cfdbe9121018.zip
Eliminate header and rpmte knowledge from rpmfs
- rpmfs is such a low-level construct it doesn't need to know anything about the upper layers. Gather the necessary bits of info in the sole caller instead and pass only whats needed to rpmfsNew() to enable creating a filestate item without having rpmte/header at hand, which we'll be needing in the fsm shortly.
Diffstat (limited to 'lib/rpmte.c')
-rw-r--r--lib/rpmte.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 65d65afdd..9325d21fa 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -201,7 +201,7 @@ static void buildRelocs(rpmte p, Header h, rpmRelocation *relocs)
*/
static int addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs)
{
- struct rpmtd_s colls;
+ struct rpmtd_s colls, bnames;
int rc = 1; /* assume failure */
p->name = headerGetAsString(h, RPMTAG_NAME);
@@ -245,7 +245,11 @@ static int addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs)
p->obsoletes = rpmdsNew(h, RPMTAG_OBSOLETENAME, 0);
p->order = rpmdsNew(h, RPMTAG_ORDERNAME, 0);
- p->fs = rpmfsNew(h, p->type);
+ /* Relocation needs to know file count before rpmfiNew() */
+ headerGet(h, RPMTAG_BASENAMES, &bnames, HEADERGET_MINMEM);
+ p->fs = rpmfsNew(rpmtdCount(&bnames), (p->type == TR_ADDED));
+ rpmtdFreeData(&bnames);
+
p->fi = getFI(p, h);
/* Packages with no files return an empty file info set, NULL is an error */