when we're upgrading from one version to the same version, don't regard
authorewt <devnull@localhost>
Wed, 7 Apr 1999 05:31:28 +0000 (05:31 +0000)
committerewt <devnull@localhost>
Wed, 7 Apr 1999 05:31:28 +0000 (05:31 +0000)
that as a true upgrade -- the old package should be left out of the
remove list

CVS patchset: 2960
CVS date: 1999/04/07 05:31:28

lib/depends.c

index 397bb6a..270dc19 100644 (file)
@@ -284,8 +284,17 @@ int rpmtransAddPackage(rpmTransactionSet rpmdep, Header h, FD_t fd,
     headerGetEntry(h, RPMTAG_NAME, NULL, (void *) &name, &count);
 
     if (!rpmdbFindPackage(rpmdep->db, name, &matches))  {
+       Header h2;
+
        for (i = 0; i < dbiIndexSetCount(matches); i++) {
-           removePackage(rpmdep, dbiIndexRecordOffset(matches, i), alNum);
+           h2 = rpmdbGetRecord(rpmdep->db, dbiIndexRecordOffset(matches, i));
+           if (h2) {
+               if (rpmVersionCompare(h, h2)) {
+                   removePackage(rpmdep, dbiIndexRecordOffset(matches, i), 
+                                 alNum);
+               }
+               headerFree(h2);
+           }
        }
 
        dbiFreeIndexRecord(matches);