From 5a6fb291ad16ce4110e65adf2d29e8ccfe6fa25a Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Sat, 19 Jun 2021 09:07:35 +0200 Subject: 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 Reviewed-by: Michael Opdenacker Signed-off-by: Richard Purdie --- documentation/migration-guides/migration-1.5.rst | 4 ++-- documentation/migration-guides/migration-1.7.rst | 2 +- documentation/migration-guides/migration-2.1.rst | 4 ++-- documentation/migration-guides/migration-2.2.rst | 4 ++-- documentation/migration-guides/migration-2.3.rst | 2 +- documentation/migration-guides/migration-2.4.rst | 6 +++--- documentation/migration-guides/migration-2.5.rst | 4 ++-- documentation/migration-guides/migration-2.6.rst | 2 +- documentation/migration-guides/migration-2.7.rst | 2 +- documentation/migration-guides/migration-3.0.rst | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) (limited to 'documentation/migration-guides') diff --git a/documentation/migration-guides/migration-1.5.rst b/documentation/migration-guides/migration-1.5.rst index e956d9fffa..e1ba4a9a13 100644 --- a/documentation/migration-guides/migration-1.5.rst +++ b/documentation/migration-guides/migration-1.5.rst @@ -124,7 +124,7 @@ The following directory changes exist: need to refer to this directory. The ``runqemu`` script now uses this variable to find images and kernel binaries and will use BitBake to determine the directory. Alternatively, you can set the - ``DEPLOY_DIR_IMAGE`` variable in the external environment. + :term:`DEPLOY_DIR_IMAGE` variable in the external environment. - When buildhistory is enabled, its output is now written under the :term:`Build Directory` rather than @@ -333,7 +333,7 @@ Following is a list of short entries describing other changes: :term:`BAD_RECOMMENDATIONS` supports pre-renamed package names. -- ``classes/rootfs_rpm``: Implement ``BAD_RECOMMENDATIONS`` for RPM. +- ``classes/rootfs_rpm``: Implement :term:`BAD_RECOMMENDATIONS` for RPM. - ``systemd``: Remove ``systemd_unitdir`` if ``systemd`` is not in :term:`DISTRO_FEATURES`. diff --git a/documentation/migration-guides/migration-1.7.rst b/documentation/migration-guides/migration-1.7.rst index c3a50eec88..8c642da202 100644 --- a/documentation/migration-guides/migration-1.7.rst +++ b/documentation/migration-guides/migration-1.7.rst @@ -13,7 +13,7 @@ The QEMU recipe now uses a number of :term:`PACKAGECONFIG` options to enable various optional features. The method used to set defaults for these options means that existing ``local.conf`` files will need to be modified to -append to ``PACKAGECONFIG`` for ``qemu-native`` and ``nativesdk-qemu`` +append to :term:`PACKAGECONFIG` for ``qemu-native`` and ``nativesdk-qemu`` instead of setting it. In other words, to enable graphical output for QEMU, you should now have these lines in ``local.conf``:: diff --git a/documentation/migration-guides/migration-2.1.rst b/documentation/migration-guides/migration-2.1.rst index 6c5ed965dc..3135d69caa 100644 --- a/documentation/migration-guides/migration-2.1.rst +++ b/documentation/migration-guides/migration-2.1.rst @@ -62,12 +62,12 @@ Makefile Environment Changes ---------------------------- :term:`EXTRA_OEMAKE` now defaults to "" instead of -"-e MAKEFLAGS=". Setting ``EXTRA_OEMAKE`` to "-e MAKEFLAGS=" by default +"-e MAKEFLAGS=". Setting :term:`EXTRA_OEMAKE` to "-e MAKEFLAGS=" by default was a historical accident that has required many classes (e.g. ``autotools``, ``module``) and recipes to override this default in order to work with sensible build systems. When upgrading to the release, you must edit any recipe that relies upon this old default by either setting -``EXTRA_OEMAKE`` back to "-e MAKEFLAGS=" or by explicitly setting any +:term:`EXTRA_OEMAKE` back to "-e MAKEFLAGS=" or by explicitly setting any required variable value overrides using :term:`EXTRA_OEMAKE`, which is typically only needed when a Makefile sets a default value for a variable that is inappropriate for cross-compilation using the "=" diff --git a/documentation/migration-guides/migration-2.2.rst b/documentation/migration-guides/migration-2.2.rst index d6dacdf34a..cbdc6a739e 100644 --- a/documentation/migration-guides/migration-2.2.rst +++ b/documentation/migration-guides/migration-2.2.rst @@ -271,7 +271,7 @@ update the references to ensure they continue to work. The :term:`IMGDEPLOYDIR` variable was introduced to allow sstate caching of image creation results. Image recipes defining custom :term:`IMAGE_CMD` or doing postprocessing on the generated images need to be adapted to use -``IMGDEPLOYDIR`` instead of :term:`DEPLOY_DIR_IMAGE`. ``IMAGE_MANIFEST`` +:term:`IMGDEPLOYDIR` instead of :term:`DEPLOY_DIR_IMAGE`. :term:`IMAGE_MANIFEST` creation and symlinking of the most recent image file will fail otherwise. .. _migration-2.2-bitbake-changes: @@ -292,7 +292,7 @@ The following changes took place for BitBake: change is more in-line with how the other fetchers work for source control systems. Recipes that fetch from Perforce will need to be updated to use :term:`SRCREV` in place of specifying the source revision - within ``SRC_URI``. + within :term:`SRC_URI`. - Some of BitBake's internal code structures for accessing the recipe cache needed to be changed to support the new multi-configuration diff --git a/documentation/migration-guides/migration-2.3.rst b/documentation/migration-guides/migration-2.3.rst index 886d579f9b..b79bc541c5 100644 --- a/documentation/migration-guides/migration-2.3.rst +++ b/documentation/migration-guides/migration-2.3.rst @@ -36,7 +36,7 @@ Consider the following: has a ``pkg_postinst`` that calls ``systemctl`` if "systemd" is in :term:`DISTRO_FEATURES`. In the example, ``systemd-systemctl-native`` is added to :term:`PACKAGE_WRITE_DEPS`, - which is also conditional on "systemd" being in ``DISTRO_FEATURES``. + which is also conditional on "systemd" being in :term:`DISTRO_FEATURES`. - Examine Recipes that Use ``SSTATEPOSTINSTFUNCS``: You need to examine any recipe that uses ``SSTATEPOSTINSTFUNCS`` and determine diff --git a/documentation/migration-guides/migration-2.4.rst b/documentation/migration-guides/migration-2.4.rst index 07f2bef623..cab81356d8 100644 --- a/documentation/migration-guides/migration-2.4.rst +++ b/documentation/migration-guides/migration-2.4.rst @@ -51,7 +51,7 @@ occurred: ``su`` is normally provided through the shadow file format. The main ``util-linux`` package has runtime dependencies (i.e. :term:`RDEPENDS`) on the ``util-linux-su`` package - when "pam" is in ``DISTRO_FEATURES``. + when "pam" is in :term:`DISTRO_FEATURES`. - The ``switch_root`` program is now packaged in a separate "util-linux-switch-root" package for small initramfs images that @@ -72,10 +72,10 @@ occurred: change also eliminates needing to pull in the entire ``initscripts`` package. The main ``initscripts`` package has a runtime dependency (i.e. :term:`RDEPENDS`) on the ``sushell`` package when "selinux" is in - ``DISTRO_FEATURES``. + :term:`DISTRO_FEATURES`. - ``glib-2.0``: The ``glib-2.0`` package now has a recommended - runtime dependency (i.e. ``RRECOMMENDS``) on the ``shared-mime-info`` + runtime dependency (i.e. :term:`RRECOMMENDS`) on the ``shared-mime-info`` package, since large portions of GIO are not useful without the MIME database. You can remove the dependency by using the :term:`BAD_RECOMMENDATIONS` variable if diff --git a/documentation/migration-guides/migration-2.5.rst b/documentation/migration-guides/migration-2.5.rst index d14580df21..79f804fa1d 100644 --- a/documentation/migration-guides/migration-2.5.rst +++ b/documentation/migration-guides/migration-2.5.rst @@ -278,12 +278,12 @@ The following are additional changes: performance and compression. In order to build a live image with squashfs+lz4 compression enabled you should now set ``LIVE_ROOTFS_TYPE = "squashfs-lz4"`` and ensure that ``live`` is in - ``IMAGE_FSTYPES``. + :term:`IMAGE_FSTYPES`. - Recipes with an unconditional dependency on ``libpam`` are only buildable with ``pam`` in :term:`DISTRO_FEATURES`. If the dependency is truly optional then it is recommended that the dependency be - conditional upon ``pam`` being in ``DISTRO_FEATURES``. + conditional upon ``pam`` being in :term:`DISTRO_FEATURES`. - For EFI-based machines, the bootloader (``grub-efi`` by default) is installed into the image at /boot. Wic can be used to split the diff --git a/documentation/migration-guides/migration-2.6.rst b/documentation/migration-guides/migration-2.6.rst index 3216ed5ae3..a8c56ede72 100644 --- a/documentation/migration-guides/migration-2.6.rst +++ b/documentation/migration-guides/migration-2.6.rst @@ -430,7 +430,7 @@ The following miscellaneous changes occurred: .. note:: ``genericx86`` and ``genericx86-64`` retain ``kernel-modules`` as part of - the ``RRECOMMENDS`` variable setting. + the :term:`RRECOMMENDS` variable setting. - The ``LGPLv2_WHITELIST_GPL-3.0`` variable has been removed. If you are setting this variable in your configuration, set or append it to diff --git a/documentation/migration-guides/migration-2.7.rst b/documentation/migration-guides/migration-2.7.rst index 25d92296cc..69bd390603 100644 --- a/documentation/migration-guides/migration-2.7.rst +++ b/documentation/migration-guides/migration-2.7.rst @@ -72,7 +72,7 @@ License Value Corrections The following corrections have been made to the :term:`LICENSE` values set by recipes: -- *socat*: Corrected ``LICENSE`` to be "GPLv2" rather than "GPLv2+". +- *socat*: Corrected :term:`LICENSE` to be "GPLv2" rather than "GPLv2+". - *libgfortran*: Set license to "GPL-3.0-with-GCC-exception". - *elfutils*: Removed "Elfutils-Exception" and set to "GPLv2" for shared libraries diff --git a/documentation/migration-guides/migration-3.0.rst b/documentation/migration-guides/migration-3.0.rst index 163c6201c5..20c7026e8d 100644 --- a/documentation/migration-guides/migration-3.0.rst +++ b/documentation/migration-guides/migration-3.0.rst @@ -243,7 +243,7 @@ The following sanity check changes occurred. - Setting ``DEPENDS_${PN}`` anywhere (i.e. typically in a recipe) now triggers an error. The error is triggered because :term:`DEPENDS` is not a package-specific variable - unlike RDEPENDS. You should set ``DEPENDS`` instead. + unlike RDEPENDS. You should set :term:`DEPENDS` instead. - systemd currently does not work well with the musl C library because only upstream officially supports linking the library with glibc. -- cgit v1.2.3-54-g00ecf