New packages have forward sorted file lists - uninstalls should traverse
authorewt <devnull@localhost>
Mon, 29 Jan 1996 19:37:28 +0000 (19:37 +0000)
committerewt <devnull@localhost>
Mon, 29 Jan 1996 19:37:28 +0000 (19:37 +0000)
such a list backwards to give rmdir() a fighting chance

CVS patchset: 236
CVS date: 1996/01/29 19:37:28

lib/uninstall.c

index 2ecd712..7851d84 100644 (file)
@@ -224,7 +224,9 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int test) {
 
        handleSharedFiles(db, offset, fileList, fileMd5List, fileCount, fileActions);
 
-       for (i = 0; i < fileCount; i++) {
+       /* go through the filelist backwards to help insure that rmdir()
+          will work */
+       for (i = fileCount - 1; i >= 0; i--) {
            if (strcmp(prefix, "/")) {
                if ((strlen(fileList[i]) + prefixLength + 1) > fnbuffersize) {
                    fnbuffersize = (strlen(fileList[i]) + prefixLength) * 2;