All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Version sorting in BitBake
@ 2009-10-06  3:46 Denys Dmytriyenko
  2009-10-06  4:00 ` [PATCH] utils.py: add special handling for version delimiters Denys Dmytriyenko
  2009-10-06 15:23 ` [RFC] Version sorting in BitBake Otavio Salvador
  0 siblings, 2 replies; 6+ messages in thread
From: Denys Dmytriyenko @ 2009-10-06  3:46 UTC (permalink / raw)
  To: openembedded-devel

Hi,

While debugging the problem with the wrong kernel recipe being picked up by 
BitBake, based on a complex PV value (there were several instances, once of 
them recently mentioned at [1]), I found a small flaw in BitBake's version 
comparison algorithm, as it relates to -preX and -rcX versions.

For the above cases we use this format: PV = "2.6.29+2.6.30-rc5"

At this point both BitBake and opkg (I haven't tried other package managers) 
sort those PVs properly, as EOL sorts lower than any other character:

2.6.29 < 2.6.29+2.6.30-rc5 < 2.6.30

Since the introduction of MACHINE_KERNEL_PR, we moved modifiers such as 
"+gitr${SRCREV}" (or any distro/local suffixes) from PR to PV, but still 
placing them after PR for proper sorting:

PV1 = "2.6.29-${PR}+gitr${SRCREV}"
PV2 = "2.6.29+2.6.30-rc5-${PR}+gitr${SRCREV}"
PV3 = "2.6.30-${PR}+gitr${SRCREV}"

That still works with opkg, as ipkg-compare-versions sorts above PVs as 
expected - PV1 < PV2 < PV3

But BitBake now has this flaw and sorts like this: PV2 < PV1 < PV3

Looks like ipkg-compare-versions/opkg algorithm has a special handling for '-' 
and '.' characters, making them sort lower than '+', thus producing expected 
results.

I understand that this behavior can be controlled by PREFERRED_VERSION and 
DEFAULT_PREFERENCE variables. But would it make sense to also fix it in 
BitBake? I do have a patch, which I'll send next. Please provide comments.

[1] http://thread.gmane.org/gmane.comp.handhelds.openembedded/26622/focus=26634

-- 
Denys



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-10  6:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-06  3:46 [RFC] Version sorting in BitBake Denys Dmytriyenko
2009-10-06  4:00 ` [PATCH] utils.py: add special handling for version delimiters Denys Dmytriyenko
2009-10-06 15:23 ` [RFC] Version sorting in BitBake Otavio Salvador
2009-10-06 17:47   ` Denys Dmytriyenko
2009-10-09  9:03   ` Richard Purdie
2009-10-10  6:13     ` Denys Dmytriyenko

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.