Advanced versioning: How to deal with rc and pre versions

Special care needs to be taken when specify the version number for rc and pre versions of packages.

Consider the case where we have an existing 1.5 version and there's a new 1.6-rc1 release that you want to add.

If the new package is given the version number 1.6-rc1 then everything will work fine initially. However when the final release happens it will be called 1.6. If you now create a 1.6 version of the package you'll find that the packages are sorted into the following order:

  1. 1.5

  2. 1.6

  3. 1.6-rc1

This in turn result in packaging system, such as ipkg, considering the released version to be older then the rc version.

In OpenEmbedded the correct naming of pre and rc versions is to use the previous version number followed by a + followed by the new version number. So the 1.6-rc1 release would be given the version number:

These would result in the eventually ordering being:

  1. 1.5

  2. 1.5+1.6-rc1

  3. 1.6

This is the correct order and the packaging system will now work as expected.