diff options
Diffstat (limited to 'Documentation/conf.py')
-rw-r--r-- | Documentation/conf.py | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Documentation/conf.py b/Documentation/conf.py index ae672cbe7..e32436be5 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -1,4 +1,3 @@ -# Generated automatically -- do not modify! -*- buffer-read-only: t -*- # -*- coding: utf-8 -*- # # Open vSwitch documentation build configuration file, created by @@ -13,6 +12,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. +import string +import sys + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -63,10 +65,26 @@ author = u'The Open vSwitch Development Community' # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = u'2.7' # The full version, including alpha/beta/rc tags. -release = u'2.7.90' +release = None +filename = "../configure.ac" +with open(filename, 'rU') as f: + for line in f: + if 'AC_INIT' in line: + # Parse "AC_INIT(openvswitch, 2.7.90, bugs@openvswitch.org)": + release = line.split(',')[1].strip(string.whitespace + '[]') + break +if release is None: + sys.stderr.write('%s: failed to determine Open vSwitch version\n' + % filename) + sys.exit(1) + +# The short X.Y version. +# +# However, it's important to know the difference between, e.g., 2.7 +# and 2.7.90, which can be very different versions (2.7.90 may be much +# closer to 2.8 than to 2.7), so check for that. +version = release if '.90' in release else '.'.join(release.split('.')[0:2]) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. |