* bb.utils.vercmp() not consistent with debian rules
@ 2012-04-05 6:22 Lu, Lianhao
2012-04-05 6:28 ` Martin Jansa
0 siblings, 1 reply; 8+ messages in thread
From: Lu, Lianhao @ 2012-04-05 6:22 UTC (permalink / raw)
To: 'bitbake-devel@lists.openembedded.org'
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".
A pervious patch http://cgit.openembedded.org/bitbake/commit/?id=727ce6ffe33a119cb17f7d91b173f11a055eea3c seems causing the bb.utils.vercmp to specially handle the separators of "." and "-".
Is it desired to behave differently from debian rules?
Best Regards,
-Lianhao
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bb.utils.vercmp() not consistent with debian rules
2012-04-05 6:22 bb.utils.vercmp() not consistent with debian rules Lu, Lianhao
@ 2012-04-05 6:28 ` Martin Jansa
2012-04-05 6:42 ` Lu, Lianhao
0 siblings, 1 reply; 8+ messages in thread
From: Martin Jansa @ 2012-04-05 6:28 UTC (permalink / raw)
To: Lu, Lianhao; +Cc: 'bitbake-devel@lists.openembedded.org'
[-- Attachment #1: Type: text/plain, Size: 1264 bytes --]
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
At least that was what target opkg was doing for me and I had to bump PE
http://git.shr-project.org/git/?p=meta-smartphone.git;a=commit;h=cb119753a77208617936085100595e6343ade650
Cheers,
>
> A pervious patch http://cgit.openembedded.org/bitbake/commit/?id=727ce6ffe33a119cb17f7d91b173f11a055eea3c seems causing the bb.utils.vercmp to specially handle the separators of "." and "-".
>
> Is it desired to behave differently from debian rules?
>
> Best Regards,
> -Lianhao
>
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bb.utils.vercmp() not consistent with debian rules
2012-04-05 6:28 ` Martin Jansa
@ 2012-04-05 6:42 ` Lu, Lianhao
2012-04-05 12:18 ` Richard Purdie
2012-04-06 16:56 ` Mark Hatle
0 siblings, 2 replies; 8+ messages in thread
From: Lu, Lianhao @ 2012-04-05 6:42 UTC (permalink / raw)
To: Martin Jansa; +Cc: 'bitbake-devel@lists.openembedded.org'
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".
-Lianhao
> At least that was what target opkg was doing for me and I had to bump PE
> http://git.shr-project.org/git/?p=meta-smartphone.git;a=commit;h=cb119753
> a77208617936085100595e6343ade650
>
> Cheers,
>
>>
>> A pervious patch
>> http://cgit.openembedded.org/bitbake/commit/?id=727ce6ffe33a119cb17f7d91
>> b173f11a055eea3c seems causing the bb.utils.vercmp to specially handle
>> the separators of "." and "-".
>>
>> Is it desired to behave differently from debian rules?
>>
>> Best Regards,
>> -Lianhao
>>
>> _______________________________________________
>> bitbake-devel mailing list
>> bitbake-devel@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bb.utils.vercmp() not consistent with debian rules
2012-04-05 6:42 ` Lu, Lianhao
@ 2012-04-05 12:18 ` Richard Purdie
2012-04-05 12:59 ` Richard Purdie
2012-04-06 16:56 ` Mark Hatle
1 sibling, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2012-04-05 12:18 UTC (permalink / raw)
To: Lu, Lianhao; +Cc: 'bitbake-devel@lists.openembedded.org', Martin Jansa
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
".".
Cheers,
Richard
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bb.utils.vercmp() not consistent with debian rules
2012-04-05 12:18 ` Richard Purdie
@ 2012-04-05 12:59 ` Richard Purdie
2012-04-05 14:44 ` Lu, Lianhao
0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2012-04-05 12:59 UTC (permalink / raw)
To: Lu, Lianhao; +Cc: 'bitbake-devel@lists.openembedded.org', Martin Jansa
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
* opkg-compare-versions (which has a C version and a shell version!)
* bb.utils.vercmp()
* bb.utils.vercmp_string()
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
point.
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.
Cheers,
Richard
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bb.utils.vercmp() not consistent with debian rules
2012-04-05 12:59 ` Richard Purdie
@ 2012-04-05 14:44 ` Lu, Lianhao
2012-04-06 3:00 ` Lu, Lianhao
0 siblings, 1 reply; 8+ messages in thread
From: Lu, Lianhao @ 2012-04-05 14:44 UTC (permalink / raw)
To: 'bitbake-devel@lists.openembedded.org'
Richard Purdie wrote on 2012-04-05:
> 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
> * opkg-compare-versions (which has a C version and a shell version!)
> * bb.utils.vercmp()
> * bb.utils.vercmp_string()
>
> 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
> point.
>
> 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.
>
The difference between those is how to treat "separators" in version compare.
Take 2 examples, v1="3.2-r2-oe0", v1'="3.2-r2"; v2="4.4-r8-oe0", v2'="4.4-r8a"
The Debian version policy says, "...so that all the letters sort earlier than all
the non-letters and so that a tilde sorts before anything, even the end of a part."
So v1>v1', v2>v2'.
The opkg follows the Debian rules, and reports v1>v1', v2>v2'. dpkg reports the same.
The C version of opkg-compare-versions reports v1>v1', v2<v2'. (The shell version do
NOT have the function of comparison).
The bb.utils.vercmp() reports v1<v1', v2<v2'. It treats all separators(i.e. "." and "-") as tilde
in Debian rules. The bb.utils.vercmp is used both by bitbake internally and bbclass.
The bb.utils.vercmp_string() does NOT accept version string containing segments starting with
non-digital character. bb.utils.vercmp_string seems never being actually called.
Seems we have nothing consistent here. :-(
- Lianhao
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bb.utils.vercmp() not consistent with debian rules
2012-04-05 14:44 ` Lu, Lianhao
@ 2012-04-06 3:00 ` Lu, Lianhao
0 siblings, 0 replies; 8+ messages in thread
From: Lu, Lianhao @ 2012-04-06 3:00 UTC (permalink / raw)
To: 'bitbake-devel@lists.openembedded.org'
Lu, Lianhao wrote on 2012-04-05:
>
> Richard Purdie wrote on 2012-04-05:
>> On Thu, 2012-04-05 at 13:18 +0100, Richard Purdie wrote:
>>
>> So just to be clear, we have various version sorting algorithms:
>>
>> * opkg
>> * opkg-compare-versions (which has a C version and a shell version!)
>> * bb.utils.vercmp()
>> * bb.utils.vercmp_string()
>>
>> 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
>> point.
>>
>> 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.
>>
>
> The difference between those is how to treat "separators" in version compare.
> Take 2 examples, v1="3.2-r2-oe0", v1'="3.2-r2"; v2="4.4-r8-oe0", v2'="4.4-r8a"
>
> The Debian version policy says, "...so that all the letters sort earlier than all
> the non-letters and so that a tilde sorts before anything, even the end of a part."
> So v1>v1', v2>v2'.
>
> The opkg follows the Debian rules, and reports v1>v1', v2>v2'. dpkg reports the same.
>
> The C version of opkg-compare-versions reports v1>v1', v2<v2'. (The shell version do
> NOT have the function of comparison).
It turns out the opkg-compare-version is still using the source code from a very opkg
implementation. The opkg upstream has changed that in svn revision r40,
http://code.google.com/p/opkg/source/detail?r=40&path=/trunk/libopkg/pkg.c.
>
> The bb.utils.vercmp() reports v1<v1', v2<v2'. It treats all separators(i.e. "." and "-") as tilde
> in Debian rules. The bb.utils.vercmp is used both by bitbake internally and bbclass.
>
> The bb.utils.vercmp_string() does NOT accept version string containing segments starting with
> non-digital character. bb.utils.vercmp_string seems never being actually called.
>
> Seems we have nothing consistent here. :-(
>
> - Lianhao
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: bb.utils.vercmp() not consistent with debian rules
2012-04-05 6:42 ` Lu, Lianhao
2012-04-05 12:18 ` Richard Purdie
@ 2012-04-06 16:56 ` Mark Hatle
1 sibling, 0 replies; 8+ messages in thread
From: Mark Hatle @ 2012-04-06 16:56 UTC (permalink / raw)
To: bitbake-devel
On 4/5/12 1:42 AM, 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
As an FYI, RPM does:
3.2-r10 > 3.2-r2-oe0
3.2-r2 < 3.2-r2-oe0
--Mark
> 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".
>
> -Lianhao
>
>> At least that was what target opkg was doing for me and I had to bump PE
>> http://git.shr-project.org/git/?p=meta-smartphone.git;a=commit;h=cb119753
>> a77208617936085100595e6343ade650
>>
>> Cheers,
>>
>>>
>>> A pervious patch
>>> http://cgit.openembedded.org/bitbake/commit/?id=727ce6ffe33a119cb17f7d91
>>> b173f11a055eea3c seems causing the bb.utils.vercmp to specially handle
>>> the separators of "." and "-".
>>>
>>> Is it desired to behave differently from debian rules?
>>>
>>> Best Regards,
>>> -Lianhao
>>>
>>> _______________________________________________
>>> bitbake-devel mailing list
>>> bitbake-devel@lists.openembedded.org
>>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
>>
>
>
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-04-06 19:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 6:22 bb.utils.vercmp() not consistent with debian rules Lu, Lianhao
2012-04-05 6:28 ` Martin Jansa
2012-04-05 6:42 ` Lu, Lianhao
2012-04-05 12:18 ` Richard Purdie
2012-04-05 12:59 ` Richard Purdie
2012-04-05 14:44 ` Lu, Lianhao
2012-04-06 3:00 ` Lu, Lianhao
2012-04-06 16:56 ` Mark Hatle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.