[bitbake-devel] bb.utils.vercmp() not consistent with debian rules
richard.purdie at linuxfoundation.org
Thu Apr 5 14:59:31 CEST 2012
On Thu, 2012-04-05 at 13:18 +0100, Richard Purdie wrote:
> On Thu, 2012-04-05 at 06:42 +0000, Lu, Lianhao wrote:
> > Martin Jansa wrote on 2012-04-05:
> > > On Thu, Apr 05, 2012 at 06:22:00AM +0000, Lu, Lianhao wrote:
> > >> Hi guys,
> > >>
> > >> When I'm looking at the Yocto bug#2233, I find that the function
> > >> bb.utils.vercmp() is not consistent with the debian packaging
> > >> rules(http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-
> > >> Version).
> > >>
> > >> According to debian rules, "r0" is earlier than "r0-dream", but the bb.utils.vercmp() thinks "r0" is later than "r0-dream".
> > >
> > > And what about something like this:
> > >
> > > Version: 3.2-r10
> > > is older then
> > > Version: 3.2-r2-oe0
> > I think this is exactly what the debian rules wants, "3.2-r10">"3.2-r2-oe0". And opkg follows that rule.
> > The problem is that bb.utils.vercmp thinks "3.2-r2">"3.2-r2-oe0" while opkg thinks "3.2-r2"<"3.2-r2-oe0".
> All the version comparisons are meant to function the same way and the
> debian sorting is meant to be used as a guide. If that patch does break
> things, we should consider removing "-" as the separator and only use
So just to be clear, we have various version sorting algorithms:
* opkg-compare-versions (which has a C version and a shell version!)
and all these functions *need* to be consistent. Consistent is defined
in this case as following the Debian version policy. This is ignoring
the other package backends. dpkg should "just work", rpm can be
programmed to use any algorithm and is probably not consistent with this
at this point but we should probably ignore that in the equation at this
So the question is, which of the above are consistent or inconsistent
with each other (and dpkg), and how they are inconsistent. We can then
consider what to do about it.
More information about the bitbake-devel