summaryrefslogtreecommitdiffstats
path: root/documentation/tools
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/tools')
l---------documentation/tools/Containerfile.almalinux1
-rw-r--r--documentation/tools/Containerfile.apt30
l---------documentation/tools/Containerfile.debian1
-rw-r--r--documentation/tools/Containerfile.dnf29
l---------documentation/tools/Containerfile.fedora1
l---------documentation/tools/Containerfile.ubuntu1
-rw-r--r--documentation/tools/Containerfile.zypper36
-rwxr-xr-xdocumentation/tools/build-docs-container175
-rwxr-xr-xdocumentation/tools/check-glossaries90
-rw-r--r--documentation/tools/host_packages_scripts/almalinux_docs.sh1
-rw-r--r--documentation/tools/host_packages_scripts/almalinux_docs_pdf.sh1
-rw-r--r--documentation/tools/host_packages_scripts/almalinux_essential.sh5
-rw-r--r--documentation/tools/host_packages_scripts/fedora_docs.sh1
-rw-r--r--documentation/tools/host_packages_scripts/fedora_docs_pdf.sh1
-rw-r--r--documentation/tools/host_packages_scripts/fedora_essential.sh1
-rw-r--r--documentation/tools/host_packages_scripts/opensuse_docs.sh1
-rw-r--r--documentation/tools/host_packages_scripts/opensuse_docs_pdf.sh1
-rw-r--r--documentation/tools/host_packages_scripts/opensuse_essential.sh2
-rw-r--r--documentation/tools/host_packages_scripts/pip3_docs.sh1
-rw-r--r--documentation/tools/host_packages_scripts/ubuntu_docs.sh1
-rw-r--r--documentation/tools/host_packages_scripts/ubuntu_docs_pdf.sh1
-rw-r--r--documentation/tools/host_packages_scripts/ubuntu_essential.sh1
-rw-r--r--documentation/tools/update-documentation-conf158
23 files changed, 0 insertions, 540 deletions
diff --git a/documentation/tools/Containerfile.almalinux b/documentation/tools/Containerfile.almalinux
deleted file mode 120000
index 7237e9b99f..0000000000
--- a/documentation/tools/Containerfile.almalinux
+++ /dev/null
@@ -1 +0,0 @@
1Containerfile.dnf \ No newline at end of file
diff --git a/documentation/tools/Containerfile.apt b/documentation/tools/Containerfile.apt
deleted file mode 100644
index a573786f06..0000000000
--- a/documentation/tools/Containerfile.apt
+++ /dev/null
@@ -1,30 +0,0 @@
1ARG ARG_FROM=debian:12 # default value to avoid warning
2FROM $ARG_FROM
3
4ARG INCLUDE_ESSENTIAL_PACKAGES=0
5ARG ESSENTIAL=ubuntu_essential.sh
6ARG DOCS=ubuntu_docs.sh
7ARG DOCS_PDF=ubuntu_docs_pdf.sh
8
9ENV DEBIAN_FRONTEND=noninteractive
10ARG TZ=Europe/Vienna
11
12# relative to the location of the dockerfile
13COPY --chmod=777 ${ESSENTIAL} /temp/host_packages_essential.sh
14COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh
15COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh
16
17RUN ln -fs "/usr/share/zoneinfo/$TZ" /etc/localtime \
18 && apt-get update \
19 && apt-get install -y sudo \
20 && if [ "$INCLUDE_ESSENTIAL_PACKAGES" = "1" ]; then yes | /temp/host_packages_essential.sh; fi \
21 && yes | /temp/host_packages_docs.sh \
22 && yes | /temp/host_packages_docs_pdf.sh \
23 && apt-get --yes autoremove \
24 && apt-get clean \
25 && rm -rf /temp
26
27RUN git config --global --add safe.directory /docs
28
29ENTRYPOINT ["/usr/bin/env", "make", "-C", "documentation/"]
30CMD ["publish"]
diff --git a/documentation/tools/Containerfile.debian b/documentation/tools/Containerfile.debian
deleted file mode 120000
index 5a7a425197..0000000000
--- a/documentation/tools/Containerfile.debian
+++ /dev/null
@@ -1 +0,0 @@
1Containerfile.apt \ No newline at end of file
diff --git a/documentation/tools/Containerfile.dnf b/documentation/tools/Containerfile.dnf
deleted file mode 100644
index 65c5267054..0000000000
--- a/documentation/tools/Containerfile.dnf
+++ /dev/null
@@ -1,29 +0,0 @@
1ARG ARG_FROM=fedora:40 # default value to avoid warning
2FROM $ARG_FROM
3
4ARG INCLUDE_ESSENTIAL_PACKAGES=0
5ARG ESSENTIAL=fedora_essential.sh
6ARG DOCS=fedora_docs.sh
7ARG DOCS_PDF=fedora_docs_pdf.sh
8ARG PIP3=pip3_docs.sh
9
10# relative to the location of the dockerfile
11COPY --chmod=777 ${ESSENTIAL} /temp/host_packages_essential.sh
12COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh
13COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh
14COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh
15
16RUN dnf update -y \
17 && dnf install -y sudo \
18 && if [ "$INCLUDE_ESSENTIAL_PACKAGES" = "1" ]; then yes | /temp/host_packages_essential.sh; fi \
19 && yes | /temp/host_packages_docs.sh \
20 && yes | /temp/host_packages_docs_pdf.sh \
21 && yes | /temp/pip3_docs.sh \
22 && dnf autoremove -y \
23 && dnf clean all -y \
24 && rm -rf /temp
25
26RUN git config --global --add safe.directory /docs
27
28ENTRYPOINT ["/usr/bin/env", "make", "-C", "documentation/"]
29CMD ["publish"]
diff --git a/documentation/tools/Containerfile.fedora b/documentation/tools/Containerfile.fedora
deleted file mode 120000
index 7237e9b99f..0000000000
--- a/documentation/tools/Containerfile.fedora
+++ /dev/null
@@ -1 +0,0 @@
1Containerfile.dnf \ No newline at end of file
diff --git a/documentation/tools/Containerfile.ubuntu b/documentation/tools/Containerfile.ubuntu
deleted file mode 120000
index 5a7a425197..0000000000
--- a/documentation/tools/Containerfile.ubuntu
+++ /dev/null
@@ -1 +0,0 @@
1Containerfile.apt \ No newline at end of file
diff --git a/documentation/tools/Containerfile.zypper b/documentation/tools/Containerfile.zypper
deleted file mode 100644
index 3850b9ff9e..0000000000
--- a/documentation/tools/Containerfile.zypper
+++ /dev/null
@@ -1,36 +0,0 @@
1ARG ARG_FROM=opensuse/leap:15.4 # default value to avoid warning
2FROM $ARG_FROM
3
4ARG INCLUDE_ESSENTIAL_PACKAGES=0
5ARG ESSENTIAL=opensuse_essential.sh
6ARG DOCS=opensuse_docs.sh
7ARG DOCS_PDF=opensuse_docs_pdf.sh
8ARG PIP3=pip3_docs.sh
9
10# relative to the location of the dockerfile
11COPY --chmod=777 ${ESSENTIAL} /temp/host_packages_essential.sh
12COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh
13COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh
14COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh
15
16# Zypper doesn't have environment variables to specify whether to run in
17# non-interactive mode like Debian does with DEBIAN_FRONTEND and piping yes to
18# the scripts doesn't need to be enough as well, so let's force all zypper calls
19# to be non-interactive by adding the appropriate flag in the scripts.
20RUN for script in /temp/*.sh; do \
21 sed -i 's/zypper/zypper --non-interactive/' $script; \
22 done
23
24RUN zypper update -y \
25 && zypper install -y sudo \
26 && if [ "$INCLUDE_ESSENTIAL_PACKAGES" = "1" ]; then yes | /temp/host_packages_essential.sh; fi \
27 && yes | /temp/host_packages_docs.sh \
28 && yes | /temp/host_packages_docs_pdf.sh \
29 && yes | /temp/pip3_docs.sh \
30 && zypper clean --all \
31 && rm -rf /temp
32
33RUN git config --global --add safe.directory /docs
34
35ENTRYPOINT ["/usr/bin/env", "make", "-C", "documentation/"]
36CMD ["publish"]
diff --git a/documentation/tools/build-docs-container b/documentation/tools/build-docs-container
deleted file mode 100755
index f97cfc4025..0000000000
--- a/documentation/tools/build-docs-container
+++ /dev/null
@@ -1,175 +0,0 @@
1#!/usr/bin/env bash
2# -*- vim: set expandtab tabstop=2 shiftwidth=2:
3#
4# Build a container ready to build the documentation be reading the dependencies
5# listed in shell scripts in documentation/tools/host_packages_scripts, and
6# start a documentation build in this container.
7#
8# Usage:
9#
10# ./documentation/tools/build-docs-container <image> [<make target>]
11#
12# e.g.:
13#
14# ./documentation/tools/build-docs-container ubuntu:24.04 html
15#
16# Will build the docs in an Ubuntu 24.04 container in html.
17#
18# The container engine can be selected by exporting CONTAINERCMD in the
19# environment. The default is docker, but podman can also be used.
20
21set -eu -o pipefail
22
23SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
24CONTAINERCMD=${CONTAINERCMD:-docker}
25DOCS_DIR="$SCRIPT_DIR/../.."
26SH_DIR="$SCRIPT_DIR/host_packages_scripts"
27INCLUDE_ESSENTIAL_PACKAGES=${INCLUDE_ESSENTIAL_PACKAGES:-0}
28
29function usage()
30{
31 echo "$0 -- script to build documentation from within a container
32
33$0 OCI_IMAGE [make arguments...]
34
35 OCI_IMAGE is an image:tag of an OCI image hosted on hub.docker.com. It is one
36 of:
37 - debian:12
38 - debian:13
39 - fedora:39
40 - fedora:40
41 - fedora:41
42 - fedora:42
43 - leap:15.5
44 - leap:15.6
45 - ubuntu:22.04
46 - ubuntu:24.04
47 - ubuntu:25.04
48
49 [make arguments] is one or more argument to pass to the make command of
50 documentation/Makefile, see that file for what's supported. This is typically
51 intended to be used to provide specific make targets.
52 Default: publish
53
54 Environment variables:
55
56 - CONTAINERCMD can be set to 'docker' or 'podman' to select the
57 container engine (default: 'docker').
58
59 - INCLUDE_ESSENTIAL_PACKAGES can be set to 0 or 1 to also include essential
60 packages listed in documentation/tools/host_packages_scripts/*_essential.sh.
61 This is not required to build the documentation but can be useful to validate
62 the installation of packages listed in these files (default: 0).
63"
64}
65
66main ()
67{
68 if [ "$#" -lt 1 ]; then
69 usage
70 exit 1
71 fi
72
73 local image="$1"
74 shift
75
76 OCI=$(which "$CONTAINERCMD")
77
78 # docker build doesn't accept 2 colons, so "sanitize" the name
79 local sanitized_dockername
80 sanitized_dockername=$(echo "$image" | tr ':.' '-')
81
82 local version
83 version=$(echo "$image" | awk -F: '{print $NF}')
84
85 case $image in
86 # Missing latexmk texlive-gnu-freefont packages at the very least
87 # "almalinux:8"*|\
88 # "almalinux:9"*)
89 # containerfile=Containerfile.almalinux
90 # docs=almalinux_docs.sh
91 # docs_pdf=almalinux_docs_pdf.sh
92 # pip3=pip3_docs.sh
93 # ;;
94 # Missing python3-saneyaml
95 # "debian:11"*|\
96 "debian:12"*|\
97 "debian:13"*)
98 containerfile=Containerfile.debian
99 essential=ubuntu_essential.sh
100 docs=ubuntu_docs.sh
101 docs_pdf=ubuntu_docs_pdf.sh
102 ;;
103 "fedora:39"*|\
104 "fedora:40"*|\
105 "fedora:41"*|\
106 "fedora:42"*)
107 containerfile=Containerfile.fedora
108 essential=fedora_essential.sh
109 docs=fedora_docs.sh
110 docs_pdf=fedora_docs_pdf.sh
111 pip3=pip3_docs.sh
112 ;;
113 "leap:15.5"*|\
114 "leap:15.6"*)
115 image=opensuse/leap:$version
116 containerfile=Containerfile.zypper
117 essential=opensuse_essential.sh
118 docs=opensuse_docs.sh
119 docs_pdf=opensuse_docs_pdf.sh
120 pip3=pip3_docs.sh
121 ;;
122 "ubuntu:22.04"*|\
123 "ubuntu:24.04"*|\
124 "ubuntu:25.04"*)
125 containerfile=Containerfile.ubuntu
126 essential=ubuntu_essential.sh
127 docs=ubuntu_docs.sh
128 docs_pdf=ubuntu_docs_pdf.sh
129 ;;
130 *)
131 echo "$image not supported!"
132 usage
133 exit 1
134 ;;
135 esac
136
137 $OCI build \
138 --tag "yocto-docs-$sanitized_dockername:latest" \
139 --build-arg ARG_FROM="docker.io/$image" \
140 --build-arg INCLUDE_ESSENTIAL_PACKAGES="${INCLUDE_ESSENTIAL_PACKAGES}" \
141 --build-arg ESSENTIAL="$essential" \
142 --build-arg DOCS="$docs" \
143 --build-arg DOCS_PDF="$docs_pdf" \
144 --build-arg PIP3="${pip3:-}" \
145 --file "$SCRIPT_DIR/$containerfile" \
146 "$SH_DIR/"
147
148 local -a args_run=(
149 --rm
150 --interactive
151 --tty
152 --volume="$DOCS_DIR:/docs:rw"
153 --workdir=/docs
154 --security-opt label=disable
155 )
156
157 if [ "$(basename "$OCI")" = "docker" ]; then
158 args_run+=(
159 --user="$(id -u)":"$(id -g)"
160 )
161 elif [ "$(basename "$OCI")" = "podman" ]; then
162 # we need net access to fetch bitbake terms
163 args_run+=(
164 --cap-add=NET_RAW
165 --userns=keep-id
166 )
167 fi
168
169 $OCI run \
170 "${args_run[@]}" \
171 "yocto-docs-$sanitized_dockername" \
172 "$@"
173}
174
175main "$@"
diff --git a/documentation/tools/check-glossaries b/documentation/tools/check-glossaries
deleted file mode 100755
index b5dfe834e5..0000000000
--- a/documentation/tools/check-glossaries
+++ /dev/null
@@ -1,90 +0,0 @@
1#!/usr/bin/env python3
2
3import argparse
4import difflib
5import os
6import re
7
8from pathlib import Path
9
10
11def parse_arguments() -> argparse.Namespace:
12 parser = argparse.ArgumentParser(description="Print supported distributions")
13
14 parser.add_argument("-d", "--docs-dir",
15 type=Path,
16 default=Path(os.path.dirname(os.path.realpath(__file__))) / "documentation",
17 help="Path to documentation/ directory in yocto-docs")
18
19 return parser.parse_args()
20
21
22glossaries = (
23 'ref-manual/variables.rst',
24 'ref-manual/terms.rst',
25)
26
27
28def main():
29
30 args = parse_arguments()
31 in_glossary = False
32 # Pattern to match:
33 # :term:`A <ABIEXTENSION>` :term:`B` :term:`C <CACHE>`
34 glossary_re = re.compile(r":term:`(?P<letter>[A-Z]{1})( <(?P<varname>[A-Z_]+)>)?`")
35 entry_re = re.compile(r"^ :term:`(?P<entry>.+)`\s*$")
36
37 for rst in glossaries:
38
39 glossary = {}
40 rst_path = Path(args.docs_dir) / rst
41
42 with open(rst_path, "r") as f:
43 for line in f.readlines():
44 if "check_glossary_begin" in line:
45 in_glossary = True
46 continue
47 if in_glossary:
48 for m in re.finditer(glossary_re, line.strip()):
49 letter = m.group("letter")
50 varname = m.group("varname")
51 if varname is None:
52 varname = letter
53 glossary[letter] = varname
54 if "check_glossary_end" in line:
55 in_glossary = False
56 break
57
58 entries = []
59
60 with open(rst_path, "r") as f:
61 for line in f.readlines():
62 m = re.match(entry_re, line)
63 if m:
64 entries.append(m.group("entry"))
65
66 # We lower here because underscore (_) come before lowercase letters
67 # (the natural way) but after uppercase letters (which is not natural)
68 sorted_entries = sorted(entries, key=lambda t: t.lower())
69 diffs = list(difflib.unified_diff(entries,
70 sorted_entries,
71 fromfile="original_list",
72 tofile="sorted_list"))
73
74 if diffs:
75 print(f"WARNING: {rst}: entries are not properly sorted:")
76 print('\n'.join(diffs))
77
78 for letter in glossary:
79 try:
80 index = entries.index(glossary[letter])
81 except ValueError:
82 print(f"WARNING: {rst}: variable "
83 f"{glossary[letter]} in glossary does not exist")
84 if index > 0 and entries[index - 1].startswith(letter[0]):
85 print(f"WARNING: {rst}: The variable {glossary[letter]} shouldn't be in "
86 "the glossary.")
87
88
89if __name__ == "__main__":
90 main()
diff --git a/documentation/tools/host_packages_scripts/almalinux_docs.sh b/documentation/tools/host_packages_scripts/almalinux_docs.sh
deleted file mode 100644
index 8188d529a1..0000000000
--- a/documentation/tools/host_packages_scripts/almalinux_docs.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo dnf install git glibc-locale-source librsvg2-tools make python3-pip which
diff --git a/documentation/tools/host_packages_scripts/almalinux_docs_pdf.sh b/documentation/tools/host_packages_scripts/almalinux_docs_pdf.sh
deleted file mode 100644
index 8341eb8c25..0000000000
--- a/documentation/tools/host_packages_scripts/almalinux_docs_pdf.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo dnf install latexmk texlive-collection-fontsrecommended texlive-collection-latex texlive-collection-latexrecommended texlive-collection-xetex texlive-fncychap texlive-gnu-freefont texlive-tex-gyre texlive-xetex
diff --git a/documentation/tools/host_packages_scripts/almalinux_essential.sh b/documentation/tools/host_packages_scripts/almalinux_essential.sh
deleted file mode 100644
index 76c5280eeb..0000000000
--- a/documentation/tools/host_packages_scripts/almalinux_essential.sh
+++ /dev/null
@@ -1,5 +0,0 @@
1sudo dnf install -y epel-release
2sudo yum install dnf-plugins-core
3sudo dnf config-manager --set-enabled crb
4sudo dnf makecache
5sudo dnf install bzip2 ccache chrpath cpio cpp diffstat diffutils gawk gcc gcc-c++ git glibc-devel glibc-langpack-en gzip libacl make patch perl perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python3 python3-GitPython python3-jinja2 python3-pexpect python3-pip rpcgen socat tar texinfo unzip wget which xz zstd
diff --git a/documentation/tools/host_packages_scripts/fedora_docs.sh b/documentation/tools/host_packages_scripts/fedora_docs.sh
deleted file mode 100644
index 8188d529a1..0000000000
--- a/documentation/tools/host_packages_scripts/fedora_docs.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo dnf install git glibc-locale-source librsvg2-tools make python3-pip which
diff --git a/documentation/tools/host_packages_scripts/fedora_docs_pdf.sh b/documentation/tools/host_packages_scripts/fedora_docs_pdf.sh
deleted file mode 100644
index 816f1c36ec..0000000000
--- a/documentation/tools/host_packages_scripts/fedora_docs_pdf.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo dnf install 'texlive-collection-lang*' latexmk texlive-collection-fontsextra texlive-collection-fontsrecommended texlive-collection-latex texlive-collection-latexextra texlive-collection-latexrecommended texlive-collection-xetex texlive-fncychap texlive-gnu-freefont texlive-tex-gyre texlive-xetex
diff --git a/documentation/tools/host_packages_scripts/fedora_essential.sh b/documentation/tools/host_packages_scripts/fedora_essential.sh
deleted file mode 100644
index 99e5d2c0b0..0000000000
--- a/documentation/tools/host_packages_scripts/fedora_essential.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo dnf install bzip2 ccache chrpath cpio cpp diffstat diffutils file findutils gawk gcc gcc-c++ git glibc-devel glibc-langpack-en gzip hostname libacl make patch perl perl-Data-Dumper perl-File-Compare perl-File-Copy perl-FindBin perl-Text-ParseWords perl-Thread-Queue perl-bignum perl-locale python python3 python3-GitPython python3-jinja2 python3-pexpect python3-pip rpcgen socat tar texinfo unzip wget which xz zstd $([ $(rpm -E %fedora) -ge 42 ] && echo "util-linux-script")
diff --git a/documentation/tools/host_packages_scripts/opensuse_docs.sh b/documentation/tools/host_packages_scripts/opensuse_docs.sh
deleted file mode 100644
index 7d36eb0f99..0000000000
--- a/documentation/tools/host_packages_scripts/opensuse_docs.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo zypper install git glibc-i18ndata make python3-pip rsvg-convert which
diff --git a/documentation/tools/host_packages_scripts/opensuse_docs_pdf.sh b/documentation/tools/host_packages_scripts/opensuse_docs_pdf.sh
deleted file mode 100644
index ee9f07886c..0000000000
--- a/documentation/tools/host_packages_scripts/opensuse_docs_pdf.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo zypper install 'texlive-collection-lang*' texlive-collection-fontsextra texlive-collection-fontsrecommended texlive-collection-latex texlive-collection-latexextra texlive-collection-latexrecommended texlive-collection-xetex texlive-fncychap texlive-gnu-freefont texlive-latexmk texlive-tex-gyre texlive-xetex
diff --git a/documentation/tools/host_packages_scripts/opensuse_essential.sh b/documentation/tools/host_packages_scripts/opensuse_essential.sh
deleted file mode 100644
index 0d37e9bd5a..0000000000
--- a/documentation/tools/host_packages_scripts/opensuse_essential.sh
+++ /dev/null
@@ -1,2 +0,0 @@
1sudo zypper install bzip2 chrpath diffstat gcc gcc-c++ git gzip hostname libacl1 make makeinfo patch python python-curses python-xml python3 python3-Jinja2 python3-curses python3-pexpect python3-pip rpcgen socat tar wget which xz zstd
2sudo pip3 install GitPython
diff --git a/documentation/tools/host_packages_scripts/pip3_docs.sh b/documentation/tools/host_packages_scripts/pip3_docs.sh
deleted file mode 100644
index fd6ad98053..0000000000
--- a/documentation/tools/host_packages_scripts/pip3_docs.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo pip3 install sphinx sphinx_rtd_theme pyyaml
diff --git a/documentation/tools/host_packages_scripts/ubuntu_docs.sh b/documentation/tools/host_packages_scripts/ubuntu_docs.sh
deleted file mode 100644
index d2a1832e27..0000000000
--- a/documentation/tools/host_packages_scripts/ubuntu_docs.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo apt install git librsvg2-bin locales make python3-saneyaml python3-saneyaml python3-sphinx-rtd-theme sphinx
diff --git a/documentation/tools/host_packages_scripts/ubuntu_docs_pdf.sh b/documentation/tools/host_packages_scripts/ubuntu_docs_pdf.sh
deleted file mode 100644
index d6310bd21d..0000000000
--- a/documentation/tools/host_packages_scripts/ubuntu_docs_pdf.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo apt install fonts-freefont-otf latexmk tex-gyre texlive-fonts-extra texlive-fonts-recommended texlive-lang-all texlive-latex-extra texlive-latex-recommended texlive-xetex
diff --git a/documentation/tools/host_packages_scripts/ubuntu_essential.sh b/documentation/tools/host_packages_scripts/ubuntu_essential.sh
deleted file mode 100644
index 6584a0403d..0000000000
--- a/documentation/tools/host_packages_scripts/ubuntu_essential.sh
+++ /dev/null
@@ -1 +0,0 @@
1sudo apt-get install build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd
diff --git a/documentation/tools/update-documentation-conf b/documentation/tools/update-documentation-conf
deleted file mode 100644
index adfca3ca50..0000000000
--- a/documentation/tools/update-documentation-conf
+++ /dev/null
@@ -1,158 +0,0 @@
1#!/usr/bin/env python
2#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5# documentation.conf update script
6#
7# Author: Paul Eggleton <paul.eggleton@linux.intel.com>
8#
9# Copyright (C) 2015 Intel Corporation
10#
11
12
13import sys
14import os
15import argparse
16import re
17from lxml import etree
18import logging
19
20def logger_create(name):
21 logger = logging.getLogger(name)
22 loggerhandler = logging.StreamHandler()
23 loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
24 logger.addHandler(loggerhandler)
25 logger.setLevel(logging.INFO)
26 return logger
27logger = logger_create('docconfupdater')
28
29def main():
30 parser = argparse.ArgumentParser(description="documentation.conf updater")
31 parser.add_argument('basepath', help='Path to OE-Core base directory')
32 parser.add_argument('-q', '--quiet', help='Print only warnings/errors', action='store_true')
33
34 args = parser.parse_args()
35
36 if args.quiet:
37 logger.setLevel(logging.WARN)
38
39 if not os.path.isdir(args.basepath):
40 logger.error('Specified base path %s not found')
41 return 1
42
43 doc_conf = os.path.join(args.basepath, 'meta', 'conf', 'documentation.conf')
44 if not os.path.exists(doc_conf):
45 logger.error('Unable to find %s' % doc_conf)
46 return 1
47
48 allowed_flags = ['doc']
49 flag_re = re.compile(r'\[(.+?)\]')
50
51 infos = {}
52 tree = etree.parse('ref-manual/ref-variables.xml')
53 root = tree.getroot()
54 for glossary in root.findall('glossary'):
55 for glossdiv in glossary.findall('glossdiv'):
56 for glossentry in glossdiv.findall('glossentry'):
57 info = glossentry.find('info')
58 if info is not None:
59 infoline = ' '.join(info.text.split())
60 infolinesplit = infoline.split('=', 1)
61 if len(infoline) < 2:
62 logger.warn('Invalid info line (no = character), ignoring: %s' % infoline)
63 continue
64 flags = flag_re.findall(infolinesplit[0])
65 if not flags:
66 logger.warn('Invalid info line (no varflag), ignoring: %s' % infoline)
67 continue
68 for flag in flags:
69 if flag not in allowed_flags:
70 logger.warn('Invalid info line (varflag %s not in allowed list), ignoring: %s' % (flag, infoline))
71 continue
72 infos[infolinesplit[0].rstrip()] = infolinesplit[1].lstrip()
73
74 if not infos:
75 logger.error('ERROR: Unable to find any info tags in the glossary')
76 return 1
77
78 def sortkey(key):
79 # Underscores sort undesirably, so replace them
80 return key.split('[')[0].replace('_', '-')
81
82 changed = False
83 lines = []
84 invars = False
85 lastletter = None
86 added = []
87 with open(doc_conf, 'r') as dcf:
88 for line in dcf:
89 if not invars:
90 if line.startswith('#') and 'DESCRIPTIONS FOR VARIABLES' in line:
91 invars = True
92 elif not line.startswith('#'):
93 linesplit = line.split('=', 1)
94 if len(linesplit) > 1:
95 key = linesplit[0].rstrip()
96 lastletter = key[0]
97 # Find anything in the dict that should come before the current key
98 for dkey in sorted(infos.keys()):
99 if sortkey(dkey) < sortkey(key):
100 lines.append('%s = %s\n' % (dkey, infos[dkey]))
101 added.append(dkey)
102 del infos[dkey]
103 changed = True
104 newvalue = infos.get(key, None)
105 if newvalue:
106 del infos[key]
107 if newvalue != linesplit[1].strip():
108 lines.append('%s = %s\n' % (key, newvalue))
109 changed = True
110 continue
111 elif key in added:
112 # We already added a new value for this key, so skip it
113 continue
114 elif lastletter:
115 # Ensure we write out anything anything left over for this letter
116 for dkey in sorted(infos.keys()):
117 if dkey[0] == lastletter:
118 lines.append('%s = %s\n' % (dkey, infos[dkey]))
119 del infos[dkey]
120 changed = True
121 elif dkey[0] > lastletter:
122 # List is sorted, so we're done
123 break
124 lastletter = None
125 lines.append(line)
126
127 if not invars:
128 logger.error('ERROR: Unable to find variables section in documentation.conf')
129 return 1
130
131 if infos:
132 changed = True
133 # Write out anything left over
134 lines.append('\n\n')
135 for key in sorted(infos.keys()):
136 lines.append('%s = %s\n' % (key, infos[key]))
137
138 if changed:
139 logger.info('Updating %s' % doc_conf)
140 with open(doc_conf, 'w') as dcf:
141 for line in lines:
142 dcf.write(line)
143 else:
144 logger.info('No changes required')
145
146 return 0
147
148
149if __name__ == "__main__":
150 try:
151 ret = main()
152 except Exception:
153 ret = 1
154 import traceback
155 traceback.print_exc(5)
156 sys.exit(ret)
157
158