Count the number of failures for transaction elements
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 25 Feb 2010 10:32:57 +0000 (12:32 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 25 Feb 2010 10:33:54 +0000 (12:33 +0200)
- this lets us track whether the package itself failed or if it
  was cancelled due to parent failure

lib/rpmte.c
lib/rpmte.h

index a570876..f45781c 100644 (file)
@@ -688,18 +688,17 @@ FD_t rpmtePayload(rpmte te)
 int rpmteMarkFailed(rpmte te, rpmts ts)
 {
     rpmtsi pi = rpmtsiInit(ts);
-    int rc = 0;
     rpmte p;
 
-    te->failed = 1;
+    te->failed++;
     /* XXX we can do a much better here than this... */
     while ((p = rpmtsiNext(pi, TR_REMOVED))) {
        if (rpmteDependsOn(p) == te) {
-           p->failed = 1;
+           p->failed++;
        }
     }
     rpmtsiFree(pi);
-    return rc;
+    return te->failed;
 }
 
 int rpmteFailed(rpmte te)
index 33af0cd..c3b221e 100644 (file)
@@ -226,9 +226,11 @@ const char * rpmteNEVRA(rpmte te);
 fnpyKey rpmteKey(rpmte te);
 
 /** \ingroup rpmte
- * Return failed status of transaction element.
+ * Return failure status of transaction element.
+ * If the element itself failed, this is 1, larger count means one of
+ * it's parents failed.
  * @param te           transaction element
- * @return             1 if transaction element (or its parents) failed
+ * @return             number of failures for this transaction element
  */
 int rpmteFailed(rpmte te);