summaryrefslogtreecommitdiff
path: root/lib/legacy.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/legacy.c')
-rw-r--r--lib/legacy.c56
1 files changed, 1 insertions, 55 deletions
diff --git a/lib/legacy.c b/lib/legacy.c
index 6a8e2534d..267b136e4 100644
--- a/lib/legacy.c
+++ b/lib/legacy.c
@@ -7,6 +7,7 @@
#include <rpmlib.h>
#include <rpmmacro.h>
#include <rpmstring.h>
+#include <rpmfi.h>
#include "lib/legacy.h"
#include "debug.h"
@@ -115,61 +116,6 @@ exit:
xx = hre(h, RPMTAG_OLDFILENAMES);
}
-void rpmfiBuildFNames(Header h, rpmTag tagN,
- const char *** fnp, int * fcp)
-{
- HGE_t hge = (HGE_t)headerGetEntryMinMemory;
- HFD_t hfd = headerFreeData;
- const char ** baseNames;
- const char ** dirNames;
- uint32_t * dirIndexes;
- int count;
- const char ** fileNames;
- int size;
- rpmTag dirNameTag = 0;
- rpmTag dirIndexesTag = 0;
- rpmTagType bnt, dnt;
- char * t;
- int i, xx;
-
- if (tagN == RPMTAG_BASENAMES) {
- dirNameTag = RPMTAG_DIRNAMES;
- dirIndexesTag = RPMTAG_DIRINDEXES;
- } else if (tagN == RPMTAG_ORIGBASENAMES) {
- dirNameTag = RPMTAG_ORIGDIRNAMES;
- dirIndexesTag = RPMTAG_ORIGDIRINDEXES;
- }
-
- if (!hge(h, tagN, &bnt, (void **) &baseNames, &count)) {
- if (fnp) *fnp = NULL;
- if (fcp) *fcp = 0;
- return; /* no file list */
- }
-
- xx = hge(h, dirNameTag, &dnt, (void **) &dirNames, NULL);
- xx = hge(h, dirIndexesTag, NULL, (void **) &dirIndexes, &count);
-
- size = sizeof(*fileNames) * count;
- for (i = 0; i < count; i++)
- size += strlen(baseNames[i]) + strlen(dirNames[dirIndexes[i]]) + 1;
-
- fileNames = xmalloc(size);
- t = ((char *) fileNames) + (sizeof(*fileNames) * count);
- for (i = 0; i < count; i++) {
- fileNames[i] = t;
- t = stpcpy( stpcpy(t, dirNames[dirIndexes[i]]), baseNames[i]);
- *t++ = '\0';
- }
- baseNames = hfd(baseNames, bnt);
- dirNames = hfd(dirNames, dnt);
-
- if (fnp)
- *fnp = fileNames;
- else
- fileNames = _free(fileNames);
- if (fcp) *fcp = count;
-}
-
void expandFilelist(Header h)
{
HAE_t hae = (HAE_t)headerAddEntry;