Commit 69cf4c52 authored by Anas Nashif's avatar Anas Nashif Committed by Anas Nashif
Browse files

doc: fix version parsing

Something stopped working after we move to 1.10, this seems to fix it.

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent 7e317dbc
Loading
Loading
Loading
Loading
+6 −2
Changes for doc/conf.py: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ project = u'Zephyr Project'
copyright = u'2015-2017 Zephyr Project members and individual contributors.'
author = u'many'

if "ZEPHYR_BASE" not in os.environ:
    sys.stderr.write("$ZEPHYR_BASE environment variable undefined.\n")
    exit(1)
ZEPHYR_BASE = os.environ["ZEPHYR_BASE"]

# The following code tries to extract the information by reading the Makefile,
# when Sphinx is run directly (e.g. by Read the Docs).
@@ -61,7 +65,7 @@ try:
    version_minor = None
    patchlevel = None
    extraversion = None
    for line in open('../VERSION'):
    for line in open(os.path.join(ZEPHYR_BASE, 'VERSION')):
        key, val = [x.strip() for x in line.split('=', 2)]
        if key == 'VERSION_MAJOR':
            version_major = val
@@ -76,7 +80,7 @@ try:
except:
    pass
finally:
    if version_major and version_minor and patchlevel and extraversion:
    if version_major and version_minor and patchlevel and extraversion is not None :
        version = release = version_major + '.' + version_minor + '.' + patchlevel
        if extraversion != '':
            version = release = version + '-' + extraversion