Transaction ordering fixes (rhbz#196590, 202540, 202542, 202543, 202544)
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 25 Jun 2007 09:28:25 +0000 (12:28 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 25 Jun 2007 09:28:25 +0000 (12:28 +0300)
Patch from Fedora / Paul Nasrat.

lib/depends.c

index 7956267..3d16ca2 100644 (file)
@@ -1411,7 +1411,14 @@ rescan:
        (void) rpmteSetDegree(q, 0);
        tsbytes += rpmtePkgFileSize(q);
 
-       ordering[orderingCount] = rpmteAddedKey(q);
+       switch (rpmteType(q)) {
+       case TR_ADDED:
+            ordering[orderingCount] = rpmteAddedKey(q);
+            /*@switchbreak@*/ break;
+       case TR_REMOVED:
+            ordering[orderingCount] = RPMAL_NOMATCH;
+            /*@switchbreak@*/ break;
+        }
        orderingCount++;
        qlen--;
        loopcheck--;
@@ -1608,7 +1615,7 @@ rescan:
            continue;
 
        j = needle->orIndex;
-       if ((q = ts->order[j]) == NULL)
+       if ((q = ts->order[j]) == NULL || needle->pkgKey == RPMAL_NOMATCH)
            continue;
 
        newOrder[newOrderCount++] = q;