#include "cpio.h"
#include "install.h"
-#include "md5.h"
#include "misc.h"
#include "rpmdb.h"
#include "rpmmacro.h"
};
struct fileMemory {
- char ** md5s;
- char ** links;
char ** names;
char ** cpioNames;
struct fileInfo * files;
struct fileInfo {
char * cpioPath;
char * relativePath; /* relative to root */
- char * md5;
- char * link;
uid_t uid;
gid_t gid;
uint_32 flags;
static void freeFileMemory(struct fileMemory fileMem) {
free(fileMem.files);
- free(fileMem.md5s);
- free(fileMem.links);
free(fileMem.names);
free(fileMem.cpioNames);
}
files = *filesPtr = mem->files = malloc(sizeof(*mem->files) * fileCount);
- headerGetEntry(h, RPMTAG_FILEMD5S, NULL, (void **) &mem->md5s, NULL);
headerGetEntry(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL);
headerGetEntry(h, RPMTAG_FILEMODES, NULL, (void **) &fileModes, NULL);
headerGetEntry(h, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, NULL);
- headerGetEntry(h, RPMTAG_FILELINKTOS, NULL, (void **) &mem->links, NULL);
for (i = 0, file = files; i < fileCount; i++, file++) {
file->state = RPMFILE_STATE_NORMAL;
file->relativePath = mem->names[i];
file->cpioPath = mem->cpioNames[i] + stripPrefixLength;
file->mode = fileModes[i];
- file->md5 = mem->md5s[i];
- file->link = mem->links[i];
file->size = fileSizes[i];
file->flags = fileFlags[i];
free(fileStates);
if (freeFileMem) freeFileMemory(fileMem);
} else if (flags & RPMTRANS_FLAG_JUSTDB) {
- char ** fileNames;
-
- if (headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &fileNames,
- &fileCount)) {
+ if (headerGetEntry(h, RPMTAG_FILENAMES, NULL, NULL, &fileCount)) {
fileStates = malloc(sizeof(*fileStates) * fileCount);
memset(fileStates, RPMFILE_STATE_NORMAL, fileCount);
headerAddEntry(h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fileStates,