Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Equinox/p2/Omni Version"

< Equinox‎ | p2
Line 36: Line 36:
 
* The factory API can naturally contain some options where scheme and version string are either separate or canonical
 
* The factory API can naturally contain some options where scheme and version string are either separate or canonical
 
* When a version or version range is present without the version type prefix, the default is to use OSGi version type (this preserves backwards compatibility).
 
* When a version or version range is present without the version type prefix, the default is to use OSGi version type (this preserves backwards compatibility).
 +
 +
==Proposed Version Types==
 +
{| {{Greytable}}
 +
|-valign="top" style="background-color:#eeeeee;color:#444444;"
 +
| '''type name'''
 +
| '''description'''
 +
|- valign="top"
 +
{{Command|osgi}}
 +
| The default OSGi version type.
 +
|- valign="top"
 +
{{Command|string}}
 +
| A free form string version that may contain any character except the version range delimiters ( ) [ ] and , (comma).
 +
|- valign="top"
 +
{{Command|timestamp}}
 +
| Time stamps compared in ascending order.
 +
|- valign="top"
 +
{{Command|triplet}}
 +
| A variation on OSGi, with the same syntax, but where the a lack of qualifier > any qualifier.
 +
|}
  
  

Revision as of 18:49, 1 December 2008

Under Construction

Introduction

This page describes a proposal for adding support for non OSGi version and version ranges in Equinox p2. This page was created as a result of the discussion on the p2 call on Dec 1, 2008.

Background

There are other versioning schemes in wide use that are not compatible with OSGi version and version ranges. The problem is both syntactic and semantic.

Example of semantic issue

Many open source projects do their versioning in a fashion similar to OSGi but with one very significant difference. For two versions that are otherwise equal, a lack of qualifier signifies a higher version then when a qualifier is present. I.e.

1.0.0.alpha 
1.0.0.beta
1.0.0.rc1
1.0.0

The 1.0.0 is the final release. The qualifier happens to be in alphabetical order here but that's not always true.

Example of syntax issue

Here are some examples of versions used in Red Had Fedora distributions.

KDE Admin version 7:4.0.3-3.fc9
Compat libstdc version 33-3.2.3-63
Automake 1.4p6-15.fc7

These are not syntactically compatible with OSGi versions as they use colon, and dash as leading separators.

Current implementation in p2

The current implementation in p2 uses the classes Version and Version range to describe the two concepts and these are implementations handling only OSGi version type.

Proposed Solution

Equinox p2 should support a set of "built in" version types. After a lengthy discussion about various "chicken and egg" type of problems relating to dynamic version type specifications and when and how the need for a particular version type is detected, and when it needs to be installed the meeting came to the conclusion that support for a "handful of built in types" would be sufficient as a starting point.

  • The interfaces IVersion and IVersionRange should be used throughout the code instead of directly using the corresponding Version and VersionRange classes.
  • An IVersion is obtained by calling a factory method such as VersionFactory.create(String versionString)
  • An IVersionRange is obtained by a similar factory method
  • The version string and version range has a URI scheme like prefix to indicate the version type
  • The factory API can naturally contain some options where scheme and version string are either separate or canonical
  • When a version or version range is present without the version type prefix, the default is to use OSGi version type (this preserves backwards compatibility).

Proposed Version Types

type name description
osgi The default OSGi version type.
string A free form string version that may contain any character except the version range delimiters ( ) [ ] and , (comma).
timestamp Time stamps compared in ascending order.
triplet A variation on OSGi, with the same syntax, but where the a lack of qualifier > any qualifier.


Version Type is a property of version and version range

The introduction of version type can be made as either a separate property on IU, or as part of version.

If the type is a separate IU property, then the version and range properties would need to be syntactically very relaxed (e.g. be "just strings"), and the appropriate parser, comparator etc. would need to be picked by code based on the IU's version type property.

If the version type is instead part of the version

Back to the top