diff options
| author | Adam Blank <adam.blank.g@gmail.com> | 2025-10-22 19:59:12 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-03 17:43:31 +0000 |
| commit | b03a897c2c91776d97e801a228d0e92e14cddd32 (patch) | |
| tree | a03a389bac718c567f44636e55aacff5da40e325 /bitbake | |
| parent | 18c39854ef6bc70d2bd456bf4dd778873617e92a (diff) | |
| download | poky-b03a897c2c91776d97e801a228d0e92e14cddd32.tar.gz | |
bitbake: doc: bitbake-user-manual: AUTOREV and SRCREV_FORMAT roles in fetching
Describe the roles of AUTOREV and SRCREV_FORMAT in the fetching step.
Add their missing descriptions to the variable reference section.
Fixes [YOCTO #14498]
(Bitbake rev: fbf0a8c5711f56bd64ae4c9d2c1d5ba884508c9f)
Signed-off-by: Adam Blank <adam.blank.g@gmail.com>
Reviewed-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
| -rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst | 47 | ||||
| -rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst | 15 |
2 files changed, 57 insertions, 5 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst index f357765b77..73cb1aafd2 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst | |||
| @@ -173,6 +173,11 @@ govern the behavior of the unpack stage: | |||
| 173 | - *subdir:* Unpacks the specific URL to the specified subdirectory | 173 | - *subdir:* Unpacks the specific URL to the specified subdirectory |
| 174 | within the root directory. | 174 | within the root directory. |
| 175 | 175 | ||
| 176 | - *name:* Assigns a name to a given component of the :term:`SRC_URI`. | ||
| 177 | This component is later referenced by this name when specifying its | ||
| 178 | :term:`SRCREV` or :term:`SRC_URI` checksum, or to correctly place its | ||
| 179 | revision in the package version string with aid of :term:`SRCREV_FORMAT`. | ||
| 180 | |||
| 176 | The unpack call automatically decompresses and extracts files with ".Z", | 181 | The unpack call automatically decompresses and extracts files with ".Z", |
| 177 | ".z", ".gz", ".xz", ".zip", ".jar", ".ipk", ".rpm". ".srpm", ".deb" and | 182 | ".z", ".gz", ".xz", ".zip", ".jar", ".ipk", ".rpm". ".srpm", ".deb" and |
| 178 | ".bz2" extensions as well as various combinations of tarball extensions. | 183 | ".bz2" extensions as well as various combinations of tarball extensions. |
| @@ -453,7 +458,7 @@ This fetcher supports the following parameters: | |||
| 453 | By default, the path is ``git/``. | 458 | By default, the path is ``git/``. |
| 454 | 459 | ||
| 455 | - *"usehead":* Enables local ``git://`` URLs to use the current branch | 460 | - *"usehead":* Enables local ``git://`` URLs to use the current branch |
| 456 | HEAD as the revision for use with ``AUTOREV``. The "usehead" | 461 | HEAD as the revision for use with :term:`AUTOREV`. The "usehead" |
| 457 | parameter implies no branch and only works when the transfer protocol | 462 | parameter implies no branch and only works when the transfer protocol |
| 458 | is ``file://``. | 463 | is ``file://``. |
| 459 | 464 | ||
| @@ -843,4 +848,42 @@ submodules. However, you might find the code helpful and readable. | |||
| 843 | Auto Revisions | 848 | Auto Revisions |
| 844 | ============== | 849 | ============== |
| 845 | 850 | ||
| 846 | We need to document ``AUTOREV`` and :term:`SRCREV_FORMAT` here. | 851 | For recipes which need to use the latest revision of their source code, |
| 852 | the way to achieve it is to use :term:`AUTOREV` as the value of the | ||
| 853 | source code repository's :term:`SRCREV`:: | ||
| 854 | |||
| 855 | SRCREV = "${AUTOREV}" | ||
| 856 | |||
| 857 | .. note:: | ||
| 858 | |||
| 859 | With :term:`AUTOREV`, BitBake will always need to take the additional step of | ||
| 860 | querying the remote repository to retrieve the latest available revision. | ||
| 861 | |||
| 862 | Also, recipes using it are not part of the parsing-time cache, | ||
| 863 | and hence are parsed every time. | ||
| 864 | |||
| 865 | Multiple Source Control Repositories | ||
| 866 | ==================================== | ||
| 867 | |||
| 868 | For some recipes it is necessary to make use of more than one | ||
| 869 | version controlled source code repository. In such case, the recipe | ||
| 870 | must provide BitBake with information about how it should include | ||
| 871 | the different SCM revisions in its package version string, instead of its | ||
| 872 | usual approach with a single :term:`SRCREV`. | ||
| 873 | |||
| 874 | For this purpose, the recipe must set the :term:`SRCREV_FORMAT` | ||
| 875 | variable. Consider the following example:: | ||
| 876 | |||
| 877 | SRC_URI = " \ | ||
| 878 | git://git.some.example.com/source-tree.git;name=machine \ | ||
| 879 | git://git.some.example.com/metadata.git;name=meta \ | ||
| 880 | " | ||
| 881 | SRCREV_machine = "3f9db490a81eeb0077be3c5a5aa1388a2372232f" | ||
| 882 | SRCREV_meta = "1ac1d0ff730fe1dd1371823d562db8126750a98c" | ||
| 883 | SRCREV_FORMAT ?= "meta_machine" | ||
| 884 | |||
| 885 | The value given to :term:`SRCREV_FORMAT` references names, which were | ||
| 886 | assigned using the ``name`` parameter in the :term:`SRC_URI` definition, | ||
| 887 | and which represent the version controlled source code repositories. | ||
| 888 | In the above example, the :term:`SRC_URI` contained two URLs named | ||
| 889 | "meta" and "machine". | ||
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst index 810f886897..e112aced1b 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.rst | |||
| @@ -36,6 +36,14 @@ overview of their function and contents. | |||
| 36 | when specified allows for the Git binary from the host to be used | 36 | when specified allows for the Git binary from the host to be used |
| 37 | rather than building ``git-native``. | 37 | rather than building ``git-native``. |
| 38 | 38 | ||
| 39 | :term:`AUTOREV` | ||
| 40 | This is a special variable used during fetching. When :term:`SRCREV` is | ||
| 41 | set to the value of this variable, the latest revision from the version | ||
| 42 | controlled source code repository is used. | ||
| 43 | It should be set as follows:: | ||
| 44 | |||
| 45 | SRCREV = "${AUTOREV}" | ||
| 46 | |||
| 39 | :term:`AZ_SAS` | 47 | :term:`AZ_SAS` |
| 40 | Azure Storage Shared Access Signature, when using the | 48 | Azure Storage Shared Access Signature, when using the |
| 41 | :ref:`Azure Storage fetcher <bitbake-user-manual/bitbake-user-manual-fetching:fetchers>` | 49 | :ref:`Azure Storage fetcher <bitbake-user-manual/bitbake-user-manual-fetching:fetchers>` |
| @@ -1622,7 +1630,8 @@ overview of their function and contents. | |||
| 1622 | 1630 | ||
| 1623 | - ``name``: Specifies a name to be used for association with | 1631 | - ``name``: Specifies a name to be used for association with |
| 1624 | :term:`SRC_URI` checksums or :term:`SRCREV` when you have more than one | 1632 | :term:`SRC_URI` checksums or :term:`SRCREV` when you have more than one |
| 1625 | file or git repository specified in :term:`SRC_URI`. For example:: | 1633 | file or source control repository specified in :term:`SRC_URI`. |
| 1634 | For example:: | ||
| 1626 | 1635 | ||
| 1627 | SRC_URI = "git://example.com/foo.git;branch=main;name=first \ | 1636 | SRC_URI = "git://example.com/foo.git;branch=main;name=first \ |
| 1628 | git://example.com/bar.git;branch=main;name=second \ | 1637 | git://example.com/bar.git;branch=main;name=second \ |
| @@ -1657,11 +1666,11 @@ overview of their function and contents. | |||
| 1657 | identifier and not just a tag. | 1666 | identifier and not just a tag. |
| 1658 | 1667 | ||
| 1659 | :term:`SRCREV_FORMAT` | 1668 | :term:`SRCREV_FORMAT` |
| 1660 | Helps construct valid :term:`SRCREV` values when | 1669 | Helps construct a valid package version string when |
| 1661 | multiple source controlled URLs are used in | 1670 | multiple source controlled URLs are used in |
| 1662 | :term:`SRC_URI`. | 1671 | :term:`SRC_URI`. |
| 1663 | 1672 | ||
| 1664 | The system needs help constructing these values under these | 1673 | The system needs help constructing this value under these |
| 1665 | circumstances. Each component in the :term:`SRC_URI` is assigned a name | 1674 | circumstances. Each component in the :term:`SRC_URI` is assigned a name |
| 1666 | and these are referenced in the :term:`SRCREV_FORMAT` variable. Consider | 1675 | and these are referenced in the :term:`SRCREV_FORMAT` variable. Consider |
| 1667 | an example with URLs named "machine" and "meta". In this case, | 1676 | an example with URLs named "machine" and "meta". In this case, |
