views:

75

answers:

1

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?

+2  A: 

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.)

Jefromi
That's exactly what I was looking for; thank you! I asked the question because I was wondering whether I could avoid having to update and check the spec file back into version control with each build, by using some value like the release timestamp rather than just increments of 1.
DNS
I figured you were probably doing that, but still, a commit every seconds for a hundred years won't fill up uint32.
Jefromi