[Rpm-maint] [rpm-software-management/rpm] RPM v6 package generation rough-cut (PR #2920)

Panu Matilainen notifications at github.com
Thu Feb 22 07:33:34 UTC 2024


@pmatilai commented on this pull request.



>      headerDel(pkg->header, RPMTAG_PAYLOADDIGEST);
     headerPutString(pkg->header, RPMTAG_PAYLOADDIGEST, pld);
     headerDel(pkg->header, RPMTAG_PAYLOADDIGESTALT);
     headerPutString(pkg->header, RPMTAG_PAYLOADDIGESTALT, upld);
     pld = _free(pld);
 
+    if (pkg->rpmver >= 6) {
+	headerDel(pkg->header, RPMTAG_PAYLOADSIZE);
+	headerPutUint64(pkg->header, RPMTAG_PAYLOADSIZE, &payloadSize, 1);
+	headerDel(pkg->header, RPMTAG_PAYLOADSIZEALT);
+	headerPutUint64(pkg->header, RPMTAG_PAYLOADSIZEALT, &archiveSize, 1);

All the archive size related tags are in the signature header in v4, they're just translated and appended (as dribbles) to the main header upon package read. The reason for entirely new tags is that this is ALWAYS in the main header and thus hashed, whereas all the v4 archive size tags are always non-hashed. There's maybe no strict "we absolutely need this" use for the size, BUT since the info is easily available and is now reliable, I don't see why not. There are more useless bits of data in the header :smile: 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2920#discussion_r1498778226
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2920/review/1895109705 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240221/ad60a069/attachment.html>


More information about the Rpm-maint mailing list