From: Denys Dmytriyenko <denis@denix.org>
To: openembedded-devel@lists.openembedded.org
Subject: [RFC] Version sorting in BitBake
Date: Mon, 05 Oct 2009 23:46:46 -0400 [thread overview]
Message-ID: <20091006034646.GA22854@denix.org> (raw)
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
next reply other threads:[~2009-10-06 3:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 3:46 Denys Dmytriyenko [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091006034646.GA22854@denix.org \
--to=denis@denix.org \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.