doesn't remove files that were never installed (RPMFILE_STATE_NOTINSTALLED)

CVS patchset: 507
CVS date: 1996/03/29 20:51:20
This commit is contained in:
ewt 1996-03-29 20:51:20 +00:00
parent 78b1ae4232
commit c17b5493c1
1 changed files with 11 additions and 3 deletions

View File

@ -149,6 +149,10 @@ static int handleSharedFiles(rpmdb db, int offset, char ** fileList,
case RPMFILE_STATE_REPLACED:
message(MESS_DEBUG, " file has already been replaced\n");
break;
case RPMFILE_STATE_NOTINSTALLED:
message(MESS_DEBUG, " file was never installed\n");
break;
case RPMFILE_STATE_NORMAL:
if (!strcmp(fileMd5List[sharedList[i].mainFileNumber],
@ -213,9 +217,6 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int test) {
fnbuffer = alloca(fnbuffersize);
}
fileActions = alloca(sizeof(*fileActions) * fileCount);
for (i = 0; i < fileCount; i++) fileActions[i] = REMOVE;
getEntry(h, RPMTAG_FILESTATES, &type, (void **) &fileStatesList,
&fileCount);
getEntry(h, RPMTAG_FILEMD5S, &type, (void **) &fileMd5List,
@ -225,6 +226,13 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int test) {
getEntry(h, RPMTAG_FILEMODES, &type, (void **) &fileModesList,
&fileCount);
fileActions = alloca(sizeof(*fileActions) * fileCount);
for (i = 0; i < fileCount; i++)
if (fileStatesList[i] == RPMFILE_STATE_NOTINSTALLED)
fileActions[i] = KEEP;
else
fileActions[i] = REMOVE;
handleSharedFiles(db, offset, fileList, fileMd5List, fileCount, fileActions);
/* go through the filelist backwards to help insure that rmdir()