[Rpm-maint] [rpm-software-management/rpm] build: prioritize large packages (#1180)

Panu Matilainen notifications at github.com
Wed Apr 15 08:06:05 UTC 2020


@pmatilai commented on this pull request.



> @@ -726,16 +727,37 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch
     return rc;
 }
 
+static int compareBinaries(const void *p1, const void *p2) {
+    Package pkg1 = *(Package *)p1;
+    Package pkg2 = *(Package *)p2;
+    uint64_t size1 = headerGetNumber(pkg1->header, RPMTAG_SIZE);
+    uint64_t size2 = headerGetNumber(pkg2->header, RPMTAG_SIZE);
+    return size1 - size2;

The difference between two 64bit integers can overflow the 32bit int return code, you'll want to normalize the return one way or the other.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1180#pullrequestreview-393544857
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200415/f60469b7/attachment.html>


More information about the Rpm-maint mailing list