diff options
author | Florian Festi <ffesti@redhat.com> | 2008-12-01 21:34:59 +0100 |
---|---|---|
committer | Florian Festi <ffesti@redhat.com> | 2008-12-10 13:40:53 +0100 |
commit | 8fa80b0f35574683beb19930264fa3b572c5ed24 (patch) | |
tree | aabf3312b5139dcef857a0315559fc97e8ad721b /lib/rpmfi.c | |
parent | 196cc2ad71a6af90961ab62f9f32fc14f7c61878 (diff) | |
download | librpm-tizen-8fa80b0f35574683beb19930264fa3b572c5ed24.tar.gz librpm-tizen-8fa80b0f35574683beb19930264fa3b572c5ed24.tar.bz2 librpm-tizen-8fa80b0f35574683beb19930264fa3b572c5ed24.zip |
Create a new datastructure rpmfs aka File States that contains the information what to do with the files of an transaction element.
This patch moves rpmfi->replaced over to rpmfs. Move struct members to follow.
Diffstat (limited to 'lib/rpmfi.c')
-rw-r--r-- | lib/rpmfi.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/rpmfi.c b/lib/rpmfi.c index e1503325a..01625cbb4 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1247,9 +1247,6 @@ fprintf(stderr, "*** fi %p\t%s[%d]\n", fi, fi->Type, fi->fc); fi->actions = _free(fi->actions); fi->replacedSizes = _free(fi->replacedSizes); - fi->replaced = _free(fi->replaced); - fi->numReplaced = 0; - fi->allocatedReplaced = 0; fi->h = headerFree(fi->h); @@ -1306,9 +1303,6 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags) if (fi == NULL) /* XXX can't happen */ goto exit; - fi->replaced = NULL; - fi->numReplaced = fi->allocatedReplaced = 0; - fi->magic = RPMFIMAGIC; fi->Type = Type; fi->i = -1; @@ -1474,14 +1468,10 @@ rpmfi rpmfiUpdateState(rpmfi fi, rpmts ts, rpmte p) { char * fstates = fi->fstates; rpmFileAction * actions = fi->actions; - sharedFileInfo replaced = fi->replaced; - int numReplaced = fi->numReplaced; rpmte savep; fi->fstates = NULL; fi->actions = NULL; - fi->replaced = NULL; - fi->numReplaced = fi->allocatedReplaced = 0; /* FIX: fi->actions is NULL */ fi = rpmfiFree(fi); @@ -1493,11 +1483,6 @@ rpmfi rpmfiUpdateState(rpmfi fi, rpmts ts, rpmte p) fi->fstates = fstates; free(fi->actions); fi->actions = actions; - if (replaced) { - /* free unused memory at the end of the array */ - fi->replaced = xrealloc(replaced, numReplaced * sizeof(*replaced)); - fi->numReplaced = fi->allocatedReplaced = numReplaced; - } p->fi = fi; return fi; } @@ -1535,40 +1520,6 @@ rpm_loff_t rpmfiFReplacedSize(rpmfi fi) return rsize; } -void rpmfiAddReplaced(rpmfi fi, int pkgFileNum, int otherPkg, int otherFileNum) -{ - if (!fi->replaced) { - fi->replaced = xcalloc(3, sizeof(*fi->replaced)); - fi->allocatedReplaced = 3; - } - if (fi->numReplaced>=fi->allocatedReplaced) { - fi->allocatedReplaced += (fi->allocatedReplaced>>1) + 2; - fi->replaced = xrealloc(fi->replaced, fi->allocatedReplaced*sizeof(*fi->replaced)); - } - fi->replaced[fi->numReplaced].pkgFileNum = pkgFileNum; - fi->replaced[fi->numReplaced].otherPkg = otherPkg; - fi->replaced[fi->numReplaced].otherFileNum = otherFileNum; - - fi->numReplaced++; -} - -sharedFileInfo rpmfiGetReplaced(rpmfi fi) -{ - if (fi && fi->numReplaced) - return fi->replaced; - else - return NULL; -} - -sharedFileInfo rpmfiNextReplaced(rpmfi fi , sharedFileInfo replaced) -{ - if (fi && replaced) { - replaced++; - if (replaced - fi->replaced < fi->numReplaced) - return replaced; - } - return NULL; -} FSM_t rpmfiFSM(rpmfi fi) { |