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>
This commit is contained in:
Randy Dunlap
2026-08-11 09:44:20 -06:00
committed by Jonathan Corbet
parent f323851805
commit 22a42ee5da
+9
View File
@@ -219,6 +219,15 @@ class SphinxBuilder:
self.kernelrelease = os.environ.get("KERNELRELEASE", "unknown")
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