From: ewt Date: Sun, 7 Feb 1999 16:44:21 +0000 (+0000) Subject: uninstalls need to handle shared config files properly X-Git-Tag: rpm-4.4-release~3131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05e7aecfed2b37566433be2f648233d2dddd9102;p=platform%2Fupstream%2Frpm.git uninstalls need to handle shared config files properly CVS patchset: 2779 CVS date: 1999/02/07 16:44:21 --- diff --git a/lib/transaction.c b/lib/transaction.c index 5b69961..b7cc07a 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -872,7 +872,7 @@ static int handleRmvdInstalledFiles(struct fileInfo * fi, rpmdb db, 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; @@ -898,13 +898,15 @@ void handleOverlappedFiles(struct fileInfo * fi, hashTable ht, 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) { @@ -915,22 +917,22 @@ void handleOverlappedFiles(struct fileInfo * fi, hashTable ht, 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 &&