summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@infradead.org>2026-08-08 07:53:31 +0300
committerJonathan Corbet <corbet@lwn.net>2026-08-11 18:44:20 +0300
commit22a42ee5dad307d4236839e75929c86346cf42e3 (patch)
tree0394eb3fcecd69d480bab01befdccfa7763dd65b /tools
parentf323851805faa770bf13ad2647abac959b84ac56 (diff)
downloadlinux-22a42ee5dad307d4236839e75929c86346cf42e3.tar.xz
docs: sphinx-build-wrapper: include localversion in kernel version string
Add any localversion* text to the kernel version string so that the docs index (home) page accurately indicates what the docs build version is. E.g.: 7.2.0-rc6-next-20260807 Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260808045331.326769-1-rdunlap@infradead.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/docs/sphinx-build-wrapper9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrapper
index 1bb962202784..ec83583e229a 100755
--- a/tools/docs/sphinx-build-wrapper
+++ b/tools/docs/sphinx-build-wrapper
@@ -220,6 +220,15 @@ class SphinxBuilder:
self.pdflatex = os.environ.get("PDFLATEX", "xelatex")
#
+ # Add localversion* to kernelversion if present
+ #
+ for file in glob(os.environ["srctree"] + "/localversion*"):
+ if not file.endswith(".orig"):
+ with open(file, 'r', encoding='utf-8') as f:
+ text = f.read()
+ self.kernelversion += text
+
+ #
# Kernel main Makefile defines a PYTHON3 variable whose default is
# "python3". When set to a different value, it allows running a
# diferent version than the default official python3 package.