Skip to contentSkip to conversation

docs: sphinx-build-wrapper: include localversion in kernel version string

PATCH Applied Randy Dunlap 2 participants 2 messages Aug 8 – Aug 11

Subsystems (2)
lore
Share & tools
lore

Randy Dunlap

author reviewer
#0 lore raw

PATCH 1/1 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

---
Cc: Jonathan Corbet <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: [email protected]

 tools/docs/sphinx-build-wrapper |    9 +++++++++
 1 file changed, 9 insertions(+)
tools/docs/sphinx-build-wrapper +9 -0
@@ -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.
maintainer Applied
#1 lore raw
Quoted 8 lines · Randy Dunlap

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

Quoted 8 lines

---
Cc: Jonathan Corbet <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: [email protected]

 tools/docs/sphinx-build-wrapper |    9 +++++++++
 1 file changed, 9 insertions(+)

Applied, thanks.

jon