Strange RPM versioning problem in qemu in Rawhide

Adam Williamson awilliam at redhat.com
Tue Aug 2 18:58:08 UTC 2011


On Tue, 2011-08-02 at 15:00 +0200, Nils Philippsen wrote:
> On Tue, 2011-08-02 at 13:37 +0100, Richard W.M. Jones wrote:
> > Below are two packages.  The first one is installed, the second one is
> > built for Koji.  Yum refuses to upgrade the installed package to the
> > second one, saying:
> > 
> > Examining qemu-0.15.0-0.2.2011072859fadcc.fc17.x86_64.rpm: 2:qemu-0.15.0-0.2.2011072859fadcc.fc17.x86_64
> > qemu-0.15.0-0.2.2011072859fadcc.fc17.x86_64.rpm: does not update installed package.
> > 
> > But I don't understand why, since it seems clear that the second
> > package has a higher release than the first package.
> 
> The version comparison method of RPM is a bit quirky and non-obvious: It
> separates elements at dots (obvious) but also at changes between digits
> and other characters (non-obvious). Let's look at only the releases of
> the two packages:
> 
> 0.2.20110718525e3df.fc16
> 0.2.2011072859fadcc.fc17
> 
> Split up into the elements that RPM compares, these are:
> 
> 0, 2, 20110718525, e,     3,  df, fc, 16
> 0, 2, 2011072859,  fadcc, fc, 17
>       ^^^^^^^^^^^^
> The third elements cause this evr-comparison to have a result which you
> don't expect. Bump the second element "2" to "3" and you should be
> fine :-).

Well, in this case yes, but this problem could emerge again in a case
where there's no version bump that 'should have' been carried out. The
fundamental problem here is that git commit IDs are a single hex string,
but RPM version comparison doesn't do hex, it splits out base-10
'numeric' fields and 'alphabetic' fields.

So, we should probably update
http://fedoraproject.org/wiki/Packaging:NamingGuidelines#Release_Tag to
cover this problem: perhaps it should say that if you're going to
include the git commit ID in the package EVR at all, it should be after
the date _and a . separator_. If these had been versioned:

0.2.20110718.525e3df.fc16
0.2.20110728.59fadcc.fc17

then I believe things would have worked as expected. So that should
probably be in the guidelines. (There still remains the corner case that
you ship two different git revisions in the same day, I guess...)
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | identi.ca: adamwfedora
http://www.happyassassin.net



More information about the devel mailing list