diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-04-24 13:36:38 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-04-24 13:36:38 +0300 |
commit | 015a34e0df0f74006b48d76eae72cfdbe9121018 (patch) | |
tree | 7591eb2a15998e183b4d077fbc5a4e51a71184ce /lib/rpmfs.c | |
parent | 9f4186766c7c628b8cc67fe0c62d58cf38b51c92 (diff) | |
download | librpm-tizen-015a34e0df0f74006b48d76eae72cfdbe9121018.tar.gz librpm-tizen-015a34e0df0f74006b48d76eae72cfdbe9121018.tar.bz2 librpm-tizen-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/rpmfs.c')
-rw-r--r-- | lib/rpmfs.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/rpmfs.c b/lib/rpmfs.c index 29b537784..764618d94 100644 --- a/lib/rpmfs.c +++ b/lib/rpmfs.c @@ -1,5 +1,4 @@ #include "system.h" -#include <rpm/header.h> #include "lib/rpmfs.h" #include "debug.h" @@ -14,18 +13,13 @@ struct rpmfs_s { int allocatedReplaced; }; -rpmfs rpmfsNew(Header h, rpmElementType type) +rpmfs rpmfsNew(rpm_count_t fc, int initState) { - struct rpmtd_s bnames; rpmfs fs = xcalloc(1, sizeof(*fs)); - - headerGet(h, RPMTAG_BASENAMES, &bnames, HEADERGET_MINMEM); - fs->fc = rpmtdCount(&bnames); - rpmtdFreeData(&bnames); - + fs->fc = fc; fs->actions = xmalloc(fs->fc * sizeof(*fs->actions)); memset(fs->actions, FA_UNKNOWN, fs->fc * sizeof(*fs->actions)); - if (type == TR_ADDED) { + if (initState) { fs->states = xmalloc(sizeof(*fs->states) * fs->fc); memset(fs->states, RPMFILE_STATE_NORMAL, fs->fc); } |