diff options
author | Quentin Schulz <foss@0leil.net> | 2021-05-27 20:41:17 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-06-19 16:54:01 +0100 |
commit | 7d3f57cfd2e4322bcd96d67d330124f221a9aedd (patch) | |
tree | 5d07321b7c8bc59bb7fcc0372fab8b7a1966cf06 /documentation/ref-manual/qa-checks.rst | |
parent | 7a9b74e9d2a5cf3b1fb3ac7565c50eae6e0d4632 (diff) | |
download | poky-7d3f57cfd2e4322bcd96d67d330124f221a9aedd.tar.gz |
docs: replace ``FOO`` by :term:`FOO` where possible
If a variable has a glossary entry and some rST files write about those
variables, it's better to point to the glossary entry instead of just
highlighting it by surrounding it with two tick quotes.
This was automated by the following python script:
"""
import re
from pathlib import Path
with open('objects.inv.txt', 'r') as f:
objects = f.readlines()
with open('bitbake-objects.inv.txt', 'r') as f:
objects = objects + f.readlines()
re_term = re.compile(r'variables.html#term-([A-Z_0-9]*)')
terms = []
for obj in objects:
match = re_term.search(obj)
if match and match.group(1):
terms.append(match.group(1))
for rst in Path('.').rglob('*.rst'):
with open(rst, 'r') as f:
content = "".joing(f.readlines())
for term in terms:
content = re.sub(r'``({})``(?!.*\s*[~-]+)'.format(term), r':term:`\1`', content)
with open(rst, 'w') as f:
f.write(content)
"""
(From yocto-docs rev: ba49d9babfcb84bc5c26a68c8c3880a1d9c236d3)
Signed-off-by: Quentin Schulz <foss@0leil.net>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Reviewed-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual/qa-checks.rst')
-rw-r--r-- | documentation/ref-manual/qa-checks.rst | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/documentation/ref-manual/qa-checks.rst b/documentation/ref-manual/qa-checks.rst index 2e98713a27..a105acc2c8 100644 --- a/documentation/ref-manual/qa-checks.rst +++ b/documentation/ref-manual/qa-checks.rst | |||
@@ -88,7 +88,7 @@ Errors and Warnings | |||
88 | A file-level dependency has been identified from the specified | 88 | A file-level dependency has been identified from the specified |
89 | package on the specified files, but there is no explicit | 89 | package on the specified files, but there is no explicit |
90 | corresponding entry in :term:`RDEPENDS`. If | 90 | corresponding entry in :term:`RDEPENDS`. If |
91 | particular files are required at runtime then ``RDEPENDS`` should be | 91 | particular files are required at runtime then :term:`RDEPENDS` should be |
92 | declared in the recipe to ensure the packages providing them are | 92 | declared in the recipe to ensure the packages providing them are |
93 | built. | 93 | built. |
94 | 94 | ||
@@ -104,7 +104,7 @@ Errors and Warnings | |||
104 | :term:`RDEPENDS` value being added at the packaging | 104 | :term:`RDEPENDS` value being added at the packaging |
105 | stage rather than up front, which is usually automatic based on the | 105 | stage rather than up front, which is usually automatic based on the |
106 | contents of the package. In most cases, you should change the recipe | 106 | contents of the package. In most cases, you should change the recipe |
107 | to add an explicit ``RDEPENDS`` for the dependency. | 107 | to add an explicit :term:`RDEPENDS` for the dependency. |
108 | 108 | ||
109 | 109 | ||
110 | .. _qa-check-dev-so: | 110 | .. _qa-check-dev-so: |
@@ -152,7 +152,7 @@ Errors and Warnings | |||
152 | not explicitly add the ``.debug`` directory to the ``-dbg`` package. | 152 | not explicitly add the ``.debug`` directory to the ``-dbg`` package. |
153 | If this is the case, add the ``.debug`` directory explicitly to | 153 | If this is the case, add the ``.debug`` directory explicitly to |
154 | ``FILES_${PN}-dbg``. See :term:`FILES` for additional | 154 | ``FILES_${PN}-dbg``. See :term:`FILES` for additional |
155 | information on ``FILES``. | 155 | information on :term:`FILES`. |
156 | 156 | ||
157 | 157 | ||
158 | .. _qa-check-arch: | 158 | .. _qa-check-arch: |
@@ -235,9 +235,9 @@ Errors and Warnings | |||
235 | 235 | ||
236 | This indicates that binaries produced when building the recipe have | 236 | This indicates that binaries produced when building the recipe have |
237 | not been linked with the :term:`LDFLAGS` options | 237 | not been linked with the :term:`LDFLAGS` options |
238 | provided by the build system. Check to be sure that the ``LDFLAGS`` | 238 | provided by the build system. Check to be sure that the :term:`LDFLAGS` |
239 | variable is being passed to the linker command. A common workaround | 239 | variable is being passed to the linker command. A common workaround |
240 | for this situation is to pass in ``LDFLAGS`` using | 240 | for this situation is to pass in :term:`LDFLAGS` using |
241 | :term:`TARGET_CC_ARCH` within the recipe as | 241 | :term:`TARGET_CC_ARCH` within the recipe as |
242 | follows:: | 242 | follows:: |
243 | 243 | ||
@@ -403,7 +403,7 @@ Errors and Warnings | |||
403 | If your recipe name does not match this, or you add packages to | 403 | If your recipe name does not match this, or you add packages to |
404 | :term:`PACKAGES` that do not conform to the | 404 | :term:`PACKAGES` that do not conform to the |
405 | convention, then you will receive this error. Rename your recipe. Or, | 405 | convention, then you will receive this error. Rename your recipe. Or, |
406 | if you have added a non-conforming package name to ``PACKAGES``, | 406 | if you have added a non-conforming package name to :term:`PACKAGES`, |
407 | change the package name appropriately. | 407 | change the package name appropriately. |
408 | 408 | ||
409 | 409 | ||
@@ -431,13 +431,13 @@ Errors and Warnings | |||
431 | 431 | ||
432 | The specified recipe has a name (:term:`PN`) value that | 432 | The specified recipe has a name (:term:`PN`) value that |
433 | appears in :term:`OVERRIDES`. If a recipe is named | 433 | appears in :term:`OVERRIDES`. If a recipe is named |
434 | such that its ``PN`` value matches something already in ``OVERRIDES`` | 434 | such that its :term:`PN` value matches something already in :term:`OVERRIDES` |
435 | (e.g. ``PN`` happens to be the same as :term:`MACHINE` | 435 | (e.g. :term:`PN` happens to be the same as :term:`MACHINE` |
436 | or :term:`DISTRO`), it can have unexpected | 436 | or :term:`DISTRO`), it can have unexpected |
437 | consequences. For example, assignments such as | 437 | consequences. For example, assignments such as |
438 | ``FILES_${PN} = "xyz"`` effectively turn into ``FILES = "xyz"``. | 438 | ``FILES_${PN} = "xyz"`` effectively turn into ``FILES = "xyz"``. |
439 | Rename your recipe (or if ``PN`` is being set explicitly, change the | 439 | Rename your recipe (or if :term:`PN` is being set explicitly, change the |
440 | ``PN`` value) so that the conflict does not occur. See | 440 | :term:`PN` value) so that the conflict does not occur. See |
441 | :term:`FILES` for additional information. | 441 | :term:`FILES` for additional information. |
442 | 442 | ||
443 | 443 | ||
@@ -464,7 +464,7 @@ Errors and Warnings | |||
464 | This check looks for instances of setting ``DEPENDS_${PN}`` | 464 | This check looks for instances of setting ``DEPENDS_${PN}`` |
465 | which is erroneous (:term:`DEPENDS` is a recipe-wide variable and thus | 465 | which is erroneous (:term:`DEPENDS` is a recipe-wide variable and thus |
466 | it is not correct to specify it for a particular package, nor will such | 466 | it is not correct to specify it for a particular package, nor will such |
467 | an assignment actually work.) Set ``DEPENDS`` instead. | 467 | an assignment actually work.) Set :term:`DEPENDS` instead. |
468 | 468 | ||
469 | 469 | ||
470 | .. _qa-check-already-stripped: | 470 | .. _qa-check-already-stripped: |
@@ -499,7 +499,7 @@ Errors and Warnings | |||
499 | 499 | ||
500 | Package names must appear only once in the | 500 | Package names must appear only once in the |
501 | :term:`PACKAGES` variable. You might receive this | 501 | :term:`PACKAGES` variable. You might receive this |
502 | error if you are attempting to add a package to ``PACKAGES`` that is | 502 | error if you are attempting to add a package to :term:`PACKAGES` that is |
503 | already in the variable's value. | 503 | already in the variable's value. |
504 | 504 | ||
505 | 505 | ||
@@ -523,7 +523,7 @@ Errors and Warnings | |||
523 | in an image later on in the build process. You need to do one of the | 523 | in an image later on in the build process. You need to do one of the |
524 | following: | 524 | following: |
525 | 525 | ||
526 | - Add the files to ``FILES`` for the package you want them to appear | 526 | - Add the files to :term:`FILES` for the package you want them to appear |
527 | in (e.g. ``FILES_${``\ :term:`PN`\ ``}`` for the main | 527 | in (e.g. ``FILES_${``\ :term:`PN`\ ``}`` for the main |
528 | package). | 528 | package). |
529 | 529 | ||