Only initialize file capability cache if actually needed
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 12 Feb 2009 12:11:22 +0000 (14:11 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 12 Feb 2009 12:11:22 +0000 (14:11 +0200)
- very few packages are going to have RPMTAG_FILECAPS at all

lib/rpmfi.c

index 2720172..53ff8f7 100644 (file)
@@ -1217,7 +1217,7 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, rpmfiFlags flags)
     if (!(flags & RPMFI_NOFILESTATES))
        _hgfi(h, RPMTAG_FILESTATES, &td, defFlags, fi->fstates);
 
-    if (!(flags & RPMFI_NOFILECAPS)) {
+    if (!(flags & RPMFI_NOFILECAPS) && headerIsEntry(h, RPMTAG_FILECAPS)) {
        fi->fcapcache = strcacheNew();
        fi->fcaps = cacheTag(fi->fcapcache, h, RPMTAG_FILECAPS);
     }