doc: attempt to parse version if not in environment

Should fix the version displayed on readthedocs.
pull/2324/head
Jason Ish 9 years ago committed by Victor Julien
parent f80ce51ddf
commit bec128bbf9

@ -15,6 +15,7 @@
import sys
import os
import shlex
import re
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
@ -57,8 +58,18 @@ author = u'OISF'
# built documents.
#
# The short X.Y version.
version = os.environ.get('version', "unknown")
# The full version, including alpha/beta/rc tags.
# Attempt to extract the version configure.ac.
try:
version = os.environ.get('version', None)
if not version:
version = re.search(
"AC_INIT\(suricata,\s*(.*)?\)",
open("../../configure.ac").read()).groups()[0]
if not version:
version = "unknown"
except:
version = "unknown"
release = version
# The language for content autogenerated by Sphinx. Refer to documentation

Loading…
Cancel
Save