From: Michal Marek <mmarek@suse.com>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: Julia.Lawall@lip6.fr, Gilles.Muller@lip6.fr,
nicolas.palix@imag.fr, linux-kernel@vger.kernel.org,
cocci@systeme.lip6.fr
Subject: Re: [PATCH 2/4] scripts: add reqs python library
Date: Wed, 15 Jun 2016 21:11:45 +0200 [thread overview]
Message-ID: <5761A871.8000409@suse.com> (raw)
In-Reply-To: <20160615160224.GP11948@wotan.suse.de>
Dne 15.6.2016 v 18:02 Luis R. Rodriguez napsal(a):
> On Wed, Jun 15, 2016 at 09:50:11AM +0200, Michal Marek wrote:
>> On 2016-06-15 00:10, Luis R. Rodriguez wrote:
>>> + weight = (int(rel_specs['VERSION']) << 32) + \
>>> + (int(rel_specs['PATCHLEVEL']) << 16) + \
>>> + (sublevel << 8 ) + \
>>> + (extra * 60) + (relmod * 2)
>>
>> This is going to silently break as soon as we have a version number with
>> e.g. a time stamp embedded.
>
> Well this is adhering to a linux_version_cmp type, surely we can adjust
> it with alternatives. It just happens that with the common stuff this
> suffices.
>
> Do you have a specific string in mind I can use to test against?
You can have a look at the git history of scripts/ld-version.sh.
>> And there is actually no need to convert the
>> version string to an integer. You can convert them to arrays of
>> components and compare the components one by one.
>
> You can, however weight is used to as a generic formula to determine
> in one shot if you have a release >= than what is required. Its inspired
> by how KERNEL_VERSION() is used:
>
> #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
Yes, the kernel interface provides comparisons using the preprocessor
arithmetic, so it needs to convert the version strings to integers. But
you are providing methods to compare the versions and what happens in
these methods stays in these methods :).
Michal
next prev parent reply other threads:[~2016-06-15 19:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 22:10 [PATCH 0/4] scripts: add basic python version library and use it Luis R. Rodriguez
2016-06-14 22:10 ` [PATCH 1/4] coccicheck: propagate error and stop processing after first error Luis R. Rodriguez
2016-06-14 22:10 ` [PATCH 2/4] scripts: add reqs python library Luis R. Rodriguez
2016-06-15 6:06 ` Julia Lawall
2016-06-15 16:04 ` Luis R. Rodriguez
2016-06-15 7:50 ` Michal Marek
2016-06-15 16:02 ` Luis R. Rodriguez
2016-06-15 19:11 ` Michal Marek [this message]
2016-06-15 20:26 ` Luis R. Rodriguez
2016-06-15 20:31 ` Julia Lawall
2016-06-15 12:01 ` Aw: [Cocci] " SF Markus Elfring
2016-06-15 15:51 ` Luis R. Rodriguez
2016-06-14 22:10 ` [PATCH 3/4] coccicheck: enable use of the kernel's " Luis R. Rodriguez
2016-06-15 7:51 ` Michal Marek
2016-06-15 15:43 ` Luis R. Rodriguez
2016-06-14 22:10 ` [PATCH 4/4] scripts/coccinelle: require coccinelle >= 1.0.4 on device_node_continue.cocci Luis R. Rodriguez
2016-06-15 6:08 ` Julia Lawall
2016-06-15 15:45 ` Luis R. Rodriguez
2016-06-15 8:43 ` Julia Lawall
2016-06-15 15:49 ` Luis R. Rodriguez
2016-06-15 15:55 ` Julia Lawall
2016-06-15 16:06 ` SF Markus Elfring
2016-06-15 16:08 ` [PATCH 4/4] " Luis R. Rodriguez
2016-06-15 16:11 ` Julia Lawall
2016-06-15 16:46 ` Luis R. Rodriguez
2016-06-15 16:52 ` Julia Lawall
2016-06-15 19:08 ` Luis R. Rodriguez
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=5761A871.8000409@suse.com \
--to=mmarek@suse.com \
--cc=Gilles.Muller@lip6.fr \
--cc=Julia.Lawall@lip6.fr \
--cc=cocci@systeme.lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=nicolas.palix@imag.fr \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox