don't start mucking with filelists for packages which have already been removed!

CVS patchset: 2991
CVS date: 1999/04/13 22:47:44
This commit is contained in:
ewt 1999-04-13 22:47:44 +00:00
parent f5f4de42ec
commit e1fd3b3f25
1 changed files with 18 additions and 0 deletions

View File

@ -358,6 +358,9 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
NOTIFY((NULL, RPMCALLBACK_TRANS_START, 6, flEntries, NULL, notifyData)); NOTIFY((NULL, RPMCALLBACK_TRANS_START, 6, flEntries, NULL, notifyData));
for (fi = flList; (fi - flList) < flEntries; fi++) { for (fi = flList; (fi - flList) < flEntries; fi++) {
int k, ro;
int knownBad;
NOTIFY((NULL, RPMCALLBACK_TRANS_PROGRESS, (fi - flList), flEntries, NOTIFY((NULL, RPMCALLBACK_TRANS_PROGRESS, (fi - flList), flEntries,
NULL, notifyData)); NULL, notifyData));
@ -369,8 +372,22 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
numShared += matches[i].count; numShared += matches[i].count;
shared = sharedList = malloc(sizeof(*sharedList) * (numShared + 1)); shared = sharedList = malloc(sizeof(*sharedList) * (numShared + 1));
knownBad = 0;
for (i = 0; i < fi->fc; i++) { for (i = 0; i < fi->fc; i++) {
/* Take care not to mark files as replaced in packages that will
have been removed before we got here. */
for (j = 0; j < matches[i].count; j++) { for (j = 0; j < matches[i].count; j++) {
ro = matches[i].recs[j].recOffset;
if (ro == knownBad) continue;
for (k = 0; k < ts->orderCount; k++) {
if (ts->order[k].type == TR_REMOVED &&
ts->order[k].u.removed.dboffset == ro) break;
}
if (k < ts->orderCount) {
knownBad = ro;
continue;
}
shared->pkgFileNum = i; shared->pkgFileNum = i;
shared->otherPkg = matches[i].recs[j].recOffset; shared->otherPkg = matches[i].recs[j].recOffset;
shared->otherFileNum = matches[i].recs[j].fileNumber; shared->otherFileNum = matches[i].recs[j].fileNumber;
@ -378,6 +395,7 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
} }
dbiFreeIndexRecord(matches[i]); dbiFreeIndexRecord(matches[i]);
} }
numShared = shared - sharedList;
shared->otherPkg = -1; shared->otherPkg = -1;
free(matches); free(matches);