short mode2, char * md52, char * link2);
enum instActions decideFileFate(char * filespec, short dbMode, char * dbMd5,
char * dbLink, short newMode, char * newMd5,
- char * newLink);
+ char * newLink, int brokenMd5);
static int installArchive(char * prefix, int fd, struct fileToInstall * files,
int fileCount, notifyFunction notify,
char ** installArchive, char * tmpPath,
int len;
int childDead = 0;
+ if (!fileCount) return 0;
+
/* fd should be a gzipped cpio archive */
message(MESS_DEBUG, "installing archive into %s\n", prefix);
enum instActions decideFileFate(char * filespec, short dbMode, char * dbMd5,
char * dbLink, short newMode, char * newMd5,
- char * newLink) {
+ char * newLink, int brokenMd5) {
char buffer[1024];
char * dbAttr, * newAttr;
enum fileTypes dbWhat, newWhat, diskWhat;
struct stat sb;
- int i;
+ int i, rc;
if (lstat(filespec, &sb)) {
/* the file doesn't exist on the disk - might as well make it */
}
if (dbWhat == REG) {
- if (mdfile(filespec, buffer)) {
+ if (brokenMd5)
+ rc = mdfileBroken(filespec, buffer);
+ else
+ rc = mdfile(filespec, buffer);
+
+ if (rc) {
/* assume the file has been removed, don't freak */
message(MESS_DEBUG, " file not present - creating");
return CREATE;
newAttr = newLink;
}
- /* this order matters - we'd prefer to CREATE the file is at all
+ /* this order matters - we'd prefer to CREATE the file if at all
possible in case something else (like the timestamp) has changed */
if (!strcmp(dbAttr, buffer)) {
secFileModesList[secNum],
secFileMd5List[secNum], secFileLinksList[secNum],
fileModesList[mainNum], fileMd5List[mainNum],
- fileLinkList[mainNum]);
+ fileLinkList[mainNum],
+ !isEntry(sech, RPMTAG_RPMVERSION));
}
}