Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the RPM Epoch header have any limitations?

Tags:

RPM supports an Epoch header to provide version ordering in cases where its version comparison isn't sufficient, for example with 2.0a3 > 2.0. A package without Epoch specified is considered to have an Epoch of either 0 or -1, depending on some obscure factors. The documentation suggests that Epoch start at 1 and be incremented with each release.

Does the Epoch value have any size limitations? If I used a 32-bit or larger value, would this cause any kind of overflow?

like image 406
DNS Avatar asked Oct 23 '09 18:10

DNS


1 Answers

Is this really an issue? It's gonna take you a long time to have 2^32 releases! Anyway, I found this in the rpm source:

int rpmVersionCompare(Header first, Header second)
{
    struct rpmtd_s one, two;
    static uint32_t zero = 0;
    uint32_t *epochOne = &zero, *epochTwo = &zero;

so I'd say don't use a 64-bit epoch number. (There's a little more to it than that - it gets read through the struct rpmtd_s, which has lots of fancy schmancy void pointers, but yeah, it's uint32.)

like image 137
Cascabel Avatar answered Oct 03 '22 03:10

Cascabel