Skip to content

Commit cb9390c

Browse files
nashifAnas Nashif
authored andcommitted
doc: add full version to generated docs
Signed-off-by: Anas Nashif <[email protected]>
1 parent be25936 commit cb9390c

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

doc/conf.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,29 @@
5757
# The following code tries to extract the information by reading the Makefile,
5858
# when Sphinx is run directly (e.g. by Read the Docs).
5959
try:
60-
makefile_version_major = None
61-
makefile_version_minor = None
62-
makefile_patchlevel = None
60+
version_major = None
61+
version_minor = None
62+
patchlevel = None
63+
extraversion = None
6364
for line in open('../VERSION'):
6465
key, val = [x.strip() for x in line.split('=', 2)]
6566
if key == 'VERSION_MAJOR':
66-
makefile_version_major = val
67+
version_major = val
6768
if key == 'VERSION_MINOR':
68-
makefile_version_minor = val
69+
version_minor = val
6970
elif key == 'PATCHLEVEL':
70-
makefile_patchlevel = val
71-
if makefile_version_major and makefile_version_minor and makefile_patchlevel:
71+
patchlevel = val
72+
elif key == 'EXTRAVERSION':
73+
extraversion = val
74+
if version_major and version_minor and patchlevel and extraversion:
7275
break
7376
except:
7477
pass
7578
finally:
76-
if makefile_version_major and makefile_version_minor and makefile_patchlevel:
77-
version = release = makefile_version_major + '.' + makefile_version_minor + '.' + makefile_patchlevel
79+
if version_major and version_minor and patchlevel and extraversion:
80+
version = release = version_major + '.' + version_minor + '.' + patchlevel
81+
if extraversion != '':
82+
version = release = version + '-' + extraversion
7883
else:
7984
sys.stderr.write('Warning: Could not extract kernel version\n')
8085
version = release = "unknown version"

0 commit comments

Comments
 (0)