Cache all but FAIL results from rpmdb header verification
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 30 Nov 2011 11:38:35 +0000 (13:38 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 30 Nov 2011 11:38:35 +0000 (13:38 +0200)
- This makes a huge difference in performance if you have lots
  of unsigned packages (NOTFOUND verify result) or signed packages
  without key (NOKEY verify result) installed, as we previously
  kept checking the same headers over and over again.

lib/rpmdb.c

index 4fc2476..d3a5e23 100644 (file)
@@ -1720,7 +1720,7 @@ static rpmRC miVerifyHeader(rpmdbMatchIterator mi, const void *uh, size_t uhlen)
        msg = _free(msg);
 
        /* Mark header checked. */
-       if (mi->mi_db && mi->mi_db->db_checked && rpmrc == RPMRC_OK) {
+       if (mi->mi_db && mi->mi_db->db_checked && rpmrc != RPMRC_FAIL) {
            intHashAddEntry(mi->mi_db->db_checked, mi->mi_offset);
        }
     }