|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: