void handleOverlappedFiles(struct fileInfo * fi, hashTable ht,
rpmProblemSet probs) {
int i, j;
- struct fileInfo ** recs;
+ struct fileInfo ** recs, * otherRec = NULL;
int numRecs;
int otherPkgNum, otherFileNum;
struct stat sb;
recs[otherPkgNum]->fps[otherFileNum]))
break;
if ((otherFileNum >= 0) &&
- (recs[otherPkgNum]->actions[otherFileNum] == CREATE))
+ (recs[otherPkgNum]->actions[otherFileNum] != UNKNOWN)) {
+ otherRec = recs[otherPkgNum];
break;
+ }
}
otherPkgNum--;
}
- if (fi->type == ADDED && otherPkgNum < 0) {
+ if (fi->type == ADDED && !otherRec) {
/* If it isn't in the database, install it.
FIXME: check for config files here for .rpmorig purporses! */
if (fi->actions[i] == UNKNOWN) {
fi->actions[i] = CREATE;
}
} else if (fi->type == ADDED) {
- if (filecmp(recs[otherPkgNum]->fmodes[otherFileNum],
- recs[otherPkgNum]->fmd5s[otherFileNum],
- recs[otherPkgNum]->flinks[otherFileNum],
+ if (filecmp(otherRec->fmodes[otherFileNum],
+ otherRec->fmd5s[otherFileNum],
+ otherRec->flinks[otherFileNum],
fi->fmodes[i],
fi->fmd5s[i],
fi->flinks[i])) {
psAppend(probs, RPMPROB_NEW_FILE_CONFLICT, fi->ap->key,
- fi->ap->h, fi->fl[i], recs[otherPkgNum]->ap->h);
+ fi->ap->h, fi->fl[i], otherRec->ap->h);
}
/* FIXME: is this right??? it locks us into the config
file handling choice we already made, which may very
well be exactly right. */
- fi->actions[i] = recs[otherPkgNum]->actions[otherFileNum];
+ fi->actions[i] = otherRec->actions[otherFileNum];
recs[otherPkgNum]->actions[otherFileNum] = SKIP;
- } else if (fi->type == REMOVED && otherPkgNum >= 0) {
+ } else if (fi->type == REMOVED && otherRec) {
fi->actions[i] = SKIP;
} else if (fi->type == REMOVED) {
if (fi->actions[i] != SKIP && fi->actions[i] != SKIPNSTATE &&