[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Version Type Proposal

a range has version range delimiters - i.e. the "," (comma) between the from and to version strings. A version such as "1.2" may be seen as having one or two segments (or even three), depending on what it is compared against. If you compare it against raw(%s) it would be one segment containing the entire string, if it is raw(%d.%d): the pattern specifies "." (period) to be the delimiter and you get two segments, and if the type is raw(%d%s%d) three segments "1", "." and "2" would be generated. So - formally, "any" does not define the delimiters.

With "any" - the statement made is "I don't know what version type the "foobar" IU has, I only know that it should be '1.2-alpha:34' or later because I used '1.2-alpha:33' earlier and it did not work, I don't know about segments, if some are optional or not, nor do I know if comparisons should be numeric or alphanumeric..."

It is expected that IUs are published with a known type (i.e. not "any") as the publisher of an IU should have the knowledge to select the appropriate version. In the unlikely case that the publisher is not capable of correctly describing the version syntax/semantics, it is still possible for the publisher to use "any". To specify "any" for the IU is saying "you can interpret this version string any way you like". 

If a candidate IU is specified to have the version type "any":
- if a query is made using "any" the comparison would be a string comparison of the entire version string (i.e. single segment)
- if a query is made using a version type other than "any", the comparison would be made based on if the "any-typed" version string can be transformed to the explicit (or implicit pattern) defined by the "non-any-type". (I.e. a query for 'osgi:1.2.0' would match 'any:1.2.0').

I hope that clarifies the idea.

On Dec 3, 2008, at 10:10 PM, John Arthorne wrote:

Henrik Lindberg wrote on 12/03/2008 03:57:24 PM:

> The "any" type does not define the segment delimiter - the
> delimiters are specified by the defined types - as an example raw(%
> d:%d) defines two numerical segments with a ":" as delimiter. The
> only "delimiters" are the version range delimiters, but an any type
> string is not allowed to include them unescaped.

I'm a bit confused then. The description for the "any" type includes:

- Segments are compared in order, and a %d segment is always smaller than a %s segment
- The instance with fewer segments is smaller if the compared segments are equal

How does this work if the "any" type doesn't have segment delimiters? Also the examples have:


Which looks to me like "." is a segment delimiter.

p2-dev mailing list