Fix ts element package file size on large packages
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 17 Dec 2009 14:10:37 +0000 (16:10 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 17 Dec 2009 14:10:37 +0000 (16:10 +0200)
- RPMTAG_SIGSIZE is limited to 4GB, grab RPMTAG_LONGSIGSIZE through
  headerGetNumber() grabs the correct tag automatically and simplifies
  the code a bit

lib/rpmte.c

index 4254ffa..1684aa2 100644 (file)
@@ -307,17 +307,12 @@ rpmte rpmteNew(const rpmts ts, Header h,
                int dboffset)
 {
     rpmte p = xcalloc(1, sizeof(*p));
-    uint32_t *ep; 
-    struct rpmtd_s size;
 
     p->type = type;
     addTE(ts, p, h, key, relocs);
     switch (type) {
     case TR_ADDED:
-       headerGet(h, RPMTAG_SIGSIZE, &size, HEADERGET_DEFAULT);
-       if ((ep = rpmtdGetUint32(&size))) {
-           p->pkgFileSize += 96 + 256 + *ep;
-       }
+       p->pkgFileSize = headerGetNumber(h, RPMTAG_LONGSIGSIZE) + 96 + 256;
        break;
     case TR_REMOVED:
        /* nothing to do */