Styleguide: Difference between revisions

From Openembedded.org
Jump to navigation Jump to search
(New page: = Version policy for OE recipes = There is general confusion about what a correct PV string should look like. This page attempts to define a standard for packages in OpenEmbedded to follow...)
 
No edit summary
 
(35 intermediate revisions by 12 users not shown)
Line 1: Line 1:
= Version policy for OE recipes =
This page has moved to the [https://docs.yoctoproject.org/dev/contributor-guide/recipe-style-guide.html Yocto Documentation Contributors Guide]
There is general confusion about what a correct PV string should look like. This page attempts to define a standard for packages in OpenEmbedded to follow. Whilst not mandatory, it is strongly recommended.
OE's versioning policy aims to follow that of Debian (and is hence compatible with ipkg).
Debian's PV policy can be viewed at [http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version]
 
One key phrase to note is "The lexical comparison is a comparison of ASCII values modified so that all the letters sort earlier than all the non-letters." This means characters like + and - have a higher priority than alphanumeric characters.
If in doubt, experiment with the ipkg-compare-versions program from ipkg-utils.
 
'''NOTE''': this page was based on a [http://handhelds.org/hypermail/oe/42/4249.html email-thread] from [http://lists.openembedded.org/pipermail/openembedded-devel/ openembedded-devel@lists.openembedded.org] and subsequent dicussions.
 
== Hyphens ==
Our current policy is:
 
* PN may contain hypens
* PV should avoid containing hypens
* PR '''must not''' contain hyphens
 
It is a common misconception that hyphens are not allowed in PV. Looking at packages/linux shows they can be used but extreme caution is recommended (see pitfalls below). They wouldn't be allowed under Debian rules if PR wasn't specificed but since OE always sets PR by default, hyphens are allowed by default.
             
== Date based packages ==
 
The current policy is to use the format PV = "1.2+scmYYYYMMDD".
 
* cvs packages should use <latest released version>+cvs<date>, e.g. foo_1.3+cvs20051106
* svn packages should use <latest released version>+svn<date>, e.g. foo_1.3+svn20051106
 
== Pitfalls ==
 
Prerelease packages such as
 
* foo_2.4.4rc2
* foo_2.4.4b1
* foo_2.4.4-git5
* foo_2.4.4-pre1
 
cause a lot of trouble with package managers when ''foo_2.4.4'' gets released. So we should use the following:
 
* foo_2.4.3+2.4.4rc2
 
[[Category:Policy]]

Latest revision as of 16:54, 30 August 2023

This page has moved to the Yocto Documentation Contributors Guide