diff options
author | Quentin Schulz <foss@0leil.net> | 2021-06-19 09:07:35 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-16 21:59:31 +0100 |
commit | 5a6fb291ad16ce4110e65adf2d29e8ccfe6fa25a (patch) | |
tree | df43222dc7a0def1bbc6246ca2a33953f85e584f /documentation/dev-manual | |
parent | be3e14dd43220db034a63b7a9f5516feb6a00110 (diff) | |
download | poky-5a6fb291ad16ce4110e65adf2d29e8ccfe6fa25a.tar.gz |
docs: replace remaining ``FOO`` by :term:`FOO`
A few occurences appeared between the time the original patch was sent
and it was applied, this fixes it.
Also, the original patch didn't take into account lowercase terms, this
is now fixed, see module_autoload for example.
Finally, as is often the case with regexp, there was a typo in it that
didn't make it match as much as it should have.
The script that is used to do the replacement of ``FOO`` by :term:`FOO`
is the following Python code:
import re
from pathlib import Path
from runpy import run_module
import contextlib
import io
import sys
re_term = re.compile(r'variables.html#term-([a-zA-Z_0-9]*)')
terms = []
new_terms = set()
with contextlib.redirect_stdout(io.StringIO()) as f:
run_module('sphinx.ext.intersphinx', run_name='__main__')
objects = f.getvalue()
match = re_term.search(objects)
while match:
if match.group(1):
terms.append(match.group(1))
match = re_term.search(objects, match.end())
for rst in Path('.').rglob('*.rst'):
with open(rst, 'r') as f:
content = "".join(f.readlines())
for term in terms:
content = re.sub(r'``({})``(?!.*\s+[~=-]{{{:d},}})'.format(term, len(term)), r':term:`\1`', content)
with open(rst, 'w') as f:
f.write(content)
This script takes one argument as input: an objects.inv. Bitbake's can
be gotten from https://docs.yoctoproject.org/bitbake/objects.inv. The
objetcs.inv from the current git repo can be gotten from
documentation/_build/html/objetcs.inv after running `make html`.
Note that this excludes from replacement terms that appear in section
titles as it requires refs to be changed too. This can be automated too
if need be but right now it looks a bit confusing to have an anchor link
(for sections) also have a term/reference link in it. I am not sure this
is desired today.
This is the result of two runs of the aforementioned script, once with
Bitbake objects.inv and once with this repo's.
Fixes: ba49d9babfcb "docs: replace ``FOO`` by :term:`FOO` where possible"
(From yocto-docs rev: 1e1b0c4dd241b6657035172b1f7b5f341afa8b25)
Signed-off-by: Quentin Schulz <foss@0leil.net>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual')
-rw-r--r-- | documentation/dev-manual/common-tasks.rst | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/documentation/dev-manual/common-tasks.rst b/documentation/dev-manual/common-tasks.rst index 4eab12d838..2af2896171 100644 --- a/documentation/dev-manual/common-tasks.rst +++ b/documentation/dev-manual/common-tasks.rst | |||
@@ -268,7 +268,7 @@ following list: | |||
268 | quickly. | 268 | quickly. |
269 | 269 | ||
270 | In summary, you need to place all files referenced from | 270 | In summary, you need to place all files referenced from |
271 | ``SRC_URI`` in a machine-specific subdirectory within the layer in | 271 | :term:`SRC_URI` in a machine-specific subdirectory within the layer in |
272 | order to restrict those files to machine-specific builds. | 272 | order to restrict those files to machine-specific builds. |
273 | 273 | ||
274 | - *Perform Steps to Apply for Yocto Project Compatibility:* If you want | 274 | - *Perform Steps to Apply for Yocto Project Compatibility:* If you want |
@@ -1305,7 +1305,7 @@ scanning directory locations for local files in :term:`SRC_URI`. | |||
1305 | 1305 | ||
1306 | The :term:`SRC_URI` variable in your recipe must define each unique location | 1306 | The :term:`SRC_URI` variable in your recipe must define each unique location |
1307 | for your source files. It is good practice to not hard-code version | 1307 | for your source files. It is good practice to not hard-code version |
1308 | numbers in a URL used in ``SRC_URI``. Rather than hard-code these | 1308 | numbers in a URL used in :term:`SRC_URI`. Rather than hard-code these |
1309 | values, use ``${``\ :term:`PV`\ ``}``, | 1309 | values, use ``${``\ :term:`PV`\ ``}``, |
1310 | which causes the fetch process to use the version specified in the | 1310 | which causes the fetch process to use the version specified in the |
1311 | recipe filename. Specifying the version in this manner means that | 1311 | recipe filename. Specifying the version in this manner means that |
@@ -2743,7 +2743,7 @@ recognizes the machine as "crownbay". | |||
2743 | The most important variables you must set in your machine configuration | 2743 | The most important variables you must set in your machine configuration |
2744 | file or include from a lower-level configuration file are as follows: | 2744 | file or include from a lower-level configuration file are as follows: |
2745 | 2745 | ||
2746 | - ``TARGET_ARCH`` (e.g. "arm") | 2746 | - :term:`TARGET_ARCH` (e.g. "arm") |
2747 | 2747 | ||
2748 | - ``PREFERRED_PROVIDER_virtual/kernel`` | 2748 | - ``PREFERRED_PROVIDER_virtual/kernel`` |
2749 | 2749 | ||
@@ -2751,9 +2751,9 @@ file or include from a lower-level configuration file are as follows: | |||
2751 | 2751 | ||
2752 | You might also need these variables: | 2752 | You might also need these variables: |
2753 | 2753 | ||
2754 | - ``SERIAL_CONSOLES`` (e.g. "115200;ttyS0 115200;ttyS1") | 2754 | - :term:`SERIAL_CONSOLES` (e.g. "115200;ttyS0 115200;ttyS1") |
2755 | 2755 | ||
2756 | - ``KERNEL_IMAGETYPE`` (e.g. "zImage") | 2756 | - :term:`KERNEL_IMAGETYPE` (e.g. "zImage") |
2757 | 2757 | ||
2758 | - :term:`IMAGE_FSTYPES` (e.g. "tar.gz jffs2") | 2758 | - :term:`IMAGE_FSTYPES` (e.g. "tar.gz jffs2") |
2759 | 2759 | ||
@@ -3277,7 +3277,7 @@ The actual directory depends on several things: | |||
3277 | 3277 | ||
3278 | - :term:`EXTENDPE`: The epoch - (if | 3278 | - :term:`EXTENDPE`: The epoch - (if |
3279 | :term:`PE` is not specified, which is | 3279 | :term:`PE` is not specified, which is |
3280 | usually the case for most recipes, then ``EXTENDPE`` is blank). | 3280 | usually the case for most recipes, then :term:`EXTENDPE` is blank). |
3281 | 3281 | ||
3282 | - :term:`PV`: The recipe version. | 3282 | - :term:`PV`: The recipe version. |
3283 | 3283 | ||
@@ -4167,7 +4167,7 @@ your tunings to best consider build times and package feed maintenance. | |||
4167 | If :term:`DISTRO` settings change or fundamental configuration settings | 4167 | If :term:`DISTRO` settings change or fundamental configuration settings |
4168 | such as the filesystem layout, you need to work with a clean :term:`TMPDIR`. | 4168 | such as the filesystem layout, you need to work with a clean :term:`TMPDIR`. |
4169 | Sharing :term:`TMPDIR` under these circumstances might work but since it is | 4169 | Sharing :term:`TMPDIR` under these circumstances might work but since it is |
4170 | not guaranteed, you should use a clean ``TMPDIR``. | 4170 | not guaranteed, you should use a clean :term:`TMPDIR`. |
4171 | 4171 | ||
4172 | - *Enable the Appropriate Package Architecture:* By default, the | 4172 | - *Enable the Appropriate Package Architecture:* By default, the |
4173 | OpenEmbedded build system enables three levels of package | 4173 | OpenEmbedded build system enables three levels of package |
@@ -4392,7 +4392,7 @@ directory: | |||
4392 | INHERIT += "own-mirrors" | 4392 | INHERIT += "own-mirrors" |
4393 | BB_NO_NETWORK = "1" | 4393 | BB_NO_NETWORK = "1" |
4394 | 4394 | ||
4395 | The ``SOURCE_MIRROR_URL`` and ``own-mirror`` | 4395 | The :term:`SOURCE_MIRROR_URL` and ``own-mirror`` |
4396 | class set up the system to use the downloads directory as your "own | 4396 | class set up the system to use the downloads directory as your "own |
4397 | mirror". Using the :term:`BB_NO_NETWORK` variable makes sure that | 4397 | mirror". Using the :term:`BB_NO_NETWORK` variable makes sure that |
4398 | BitBake's fetching process in step 3 stays local, which means files | 4398 | BitBake's fetching process in step 3 stays local, which means files |
@@ -4676,7 +4676,7 @@ needed. | |||
4676 | 4676 | ||
4677 | For the most part, the Multilib class extension works automatically to | 4677 | For the most part, the Multilib class extension works automatically to |
4678 | extend the package name from ``${PN}`` to ``${MLPREFIX}${PN}``, where | 4678 | extend the package name from ``${PN}`` to ``${MLPREFIX}${PN}``, where |
4679 | ``MLPREFIX`` is the particular multilib (e.g. "lib32-" or "lib64-"). | 4679 | :term:`MLPREFIX` is the particular multilib (e.g. "lib32-" or "lib64-"). |
4680 | Standard variables such as | 4680 | Standard variables such as |
4681 | :term:`DEPENDS`, | 4681 | :term:`DEPENDS`, |
4682 | :term:`RDEPENDS`, | 4682 | :term:`RDEPENDS`, |
@@ -6258,7 +6258,7 @@ the following: | |||
6258 | software being packaged. Do not confuse :term:`PV` with the binary | 6258 | software being packaged. Do not confuse :term:`PV` with the binary |
6259 | package version. | 6259 | package version. |
6260 | 6260 | ||
6261 | - ``PR``: The recipe revision. | 6261 | - :term:`PR`: The recipe revision. |
6262 | 6262 | ||
6263 | - :term:`SRCPV`: The OpenEmbedded | 6263 | - :term:`SRCPV`: The OpenEmbedded |
6264 | build system uses this string to help define the value of :term:`PV` when | 6264 | build system uses this string to help define the value of :term:`PV` when |
@@ -7946,8 +7946,8 @@ output from this command:: | |||
7946 | Here are some notes on using the ``buildhistory-collect-srcrevs`` command: | 7946 | Here are some notes on using the ``buildhistory-collect-srcrevs`` command: |
7947 | 7947 | ||
7948 | - By default, only values where the :term:`SRCREV` was not hardcoded | 7948 | - By default, only values where the :term:`SRCREV` was not hardcoded |
7949 | (usually when ``AUTOREV`` is used) are reported. Use the ``-a`` | 7949 | (usually when :term:`AUTOREV` is used) are reported. Use the ``-a`` |
7950 | option to see all ``SRCREV`` values. | 7950 | option to see all :term:`SRCREV` values. |
7951 | 7951 | ||
7952 | - The output statements might not have any effect if overrides are | 7952 | - The output statements might not have any effect if overrides are |
7953 | applied elsewhere in the build system configuration. Use the | 7953 | applied elsewhere in the build system configuration. Use the |