summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual
diff options
context:
space:
mode:
authorAntonin Godard <antonin.godard@bootlin.com>2024-12-09 17:43:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-12-20 12:47:59 +0000
commitc9565b89d070d31db5f4e4ee499f4905938ed4f6 (patch)
tree38ea29bf46a83ac8df36ef5fe165342fe962604a /documentation/ref-manual
parent6968e17ae5992fd7948098e5d5221a3e106e3452 (diff)
downloadpoky-c9565b89d070d31db5f4e4ee499f4905938ed4f6.tar.gz
Update the documentation for SRCPV
The variable SRCPV is deprecated since 4.3. Instead of including SRCPV in PV, including the sign "+" is enough for bitbake to add the source control information to PKGV during the packaging phase. Update the documentation for SRCPV and the places where it was used. When instructions previously referred to SRCPV, replace by mentioning to include "+" in the assignment. In most examples, "+git" is added to PV as it is the most popular SCM. Simply adding "+" is also possible, although it is better practice to include the SCM name, so give that example. Update the gcompat example with l3afpad as it didn't include "+git" in its PV definition anymore. (From yocto-docs rev: ee16c96202e5027d1a8d7e89e11c25f127c78326) Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual')
-rw-r--r--documentation/ref-manual/variables.rst59
1 files changed, 26 insertions, 33 deletions
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index 1eee617d59..e8db89f8c9 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -209,12 +209,11 @@ system and gives an overview of their function and contents.
209 SRCREV = "${AUTOREV}" 209 SRCREV = "${AUTOREV}"
210 210
211 If you use the previous statement to retrieve the latest version of 211 If you use the previous statement to retrieve the latest version of
212 software, you need to be sure :term:`PV` contains 212 software, you need to make sure :term:`PV` contains the ``+`` sign so
213 ``${``\ :term:`SRCPV`\ ``}``. For example, suppose you have a kernel 213 :term:`bitbake` includes source control information to :term:`PKGV` when
214 recipe that inherits the :ref:`ref-classes-kernel` class and you 214 packaging the recipe. For example::
215 use the previous statement. In this example, ``${SRCPV}`` does not 215
216 automatically get into :term:`PV`. Consequently, you need to change 216 PV = "6.10.y+git"
217 :term:`PV` in your recipe so that it does contain ``${SRCPV}``.
218 217
219 For more information see the 218 For more information see the
220 ":ref:`dev-manual/packages:automatically incrementing a package version number`" 219 ":ref:`dev-manual/packages:automatically incrementing a package version number`"
@@ -5157,7 +5156,7 @@ system and gives an overview of their function and contents.
5157 The :term:`LINUX_VERSION` variable is used to define :term:`PV` 5156 The :term:`LINUX_VERSION` variable is used to define :term:`PV`
5158 for the recipe:: 5157 for the recipe::
5159 5158
5160 PV = "${LINUX_VERSION}+git${SRCPV}" 5159 PV = "${LINUX_VERSION}+git"
5161 5160
5162 :term:`LINUX_VERSION_EXTENSION` 5161 :term:`LINUX_VERSION_EXTENSION`
5163 A string extension compiled into the version string of the Linux 5162 A string extension compiled into the version string of the Linux
@@ -6720,22 +6719,14 @@ system and gives an overview of their function and contents.
6720 string. You cannot use the wildcard character in any other 6719 string. You cannot use the wildcard character in any other
6721 location of the string. 6720 location of the string.
6722 6721
6723 The specified version is matched against :term:`PV`, which 6722 The specified version is matched against :term:`PV`, which does not
6724 does not necessarily match the version part of the recipe's filename. 6723 necessarily match the version part of the recipe's filename.
6725 For example, consider two recipes ``foo_1.2.bb`` and ``foo_git.bb``
6726 where ``foo_git.bb`` contains the following assignment::
6727
6728 PV = "1.1+git${SRCPV}"
6729
6730 In this case, the correct way to select
6731 ``foo_git.bb`` is by using an assignment such as the following::
6732
6733 PREFERRED_VERSION_foo = "1.1+git%"
6734 6724
6735 Compare that previous example 6725 If you want to select a recipe named ``foo_git.bb`` which has :term:`PV`
6736 against the following incorrect example, which does not work:: 6726 set to ``1.2.3+git``, you can do so by setting ```PREFERRED_VERSION_foo``
6737 6727 to ``1.2.3%`` (i.e. simply setting ``PREFERRED_VERSION_foo`` to ``git``
6738 PREFERRED_VERSION_foo = "git" 6728 will not work as the name of the recipe isn't used, but rather its
6729 :term:`PV` definition).
6739 6730
6740 Sometimes the :term:`PREFERRED_VERSION` variable can be set by 6731 Sometimes the :term:`PREFERRED_VERSION` variable can be set by
6741 configuration files in a way that is hard to change. You can use 6732 configuration files in a way that is hard to change. You can use
@@ -8321,21 +8312,23 @@ system and gives an overview of their function and contents.
8321 (SCM). 8312 (SCM).
8322 8313
8323 :term:`SRCPV` 8314 :term:`SRCPV`
8324 Returns the version string of the current package. This string is 8315 The variable :term:`SRCPV` is deprecated. It was previously used to
8325 used to help define the value of :term:`PV`. 8316 include source control information in :term:`PV` for :term:`bitbake` to
8317 work correctly but this is no longer a requirement. Source control
8318 information will be automatically included by :term:`bitbake` in the
8319 variable :term:`PKGV` during packaging if the ``+`` sign is present in
8320 :term:`PV`.
8326 8321
8327 The :term:`SRCPV` variable is defined in the ``meta/conf/bitbake.conf`` 8322 .. note::
8328 configuration file in the :term:`Source Directory` as
8329 follows::
8330 8323
8331 SRCPV = "${@bb.fetch2.get_srcrev(d)}" 8324 The :term:`SRCPV` variable used to be defined in the
8325 ``meta/conf/bitbake.conf`` configuration file in the :term:`Source
8326 Directory` as follows::
8332 8327
8333 Recipes that need to define :term:`PV` do so with the help of the 8328 SRCPV = "${@bb.fetch2.get_srcrev(d)}"
8334 :term:`SRCPV`. For example, the ``ofono`` recipe (``ofono_git.bb``)
8335 located in ``meta/recipes-connectivity`` in the Source Directory
8336 defines :term:`PV` as follows::
8337 8329
8338 PV = "0.12-git${SRCPV}" 8330 The ``get_srcrev`` function can still be used to include source control
8331 information in variables manually.
8339 8332
8340 :term:`SRCREV` 8333 :term:`SRCREV`
8341 The revision of the source code used to build the package. This 8334 The revision of the source code used to build the package. This