Changeset 14bbcb1 in rtems-docs


Ignore:
Timestamp:
01/19/16 14:55:57 (8 years ago)
Author:
Amar Takhar <amar@…>
Branches:
4.11, 5, master
Children:
89f2347
Parents:
9b5801a
git-author:
Amar Takhar <amar@…> (01/19/16 14:55:57)
git-committer:
Amar Takhar <verm@…> (05/03/16 00:51:24)
Message:

Add minimum version check for Sphinx.

Some distributions have ancient versions we require at least 1.3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/waf.py

    r9b5801a r14bbcb1  
    11import sys, os
    22from waflib.Build import BuildContext
     3
     4
     5sphinx_min_version = (1,3)
    36
    47def cmd_spell(ctx):
     
    3336
    3437
     38
     39def check_sphinx_version(ctx, minver):
     40#       try:
     41        version = ctx.cmd_and_log(ctx.env.BIN_SPHINX_BUILD + ['--version']).split(" ")[-1:][0]
     42        ver = tuple(map(int, version.split(".")))
     43#       except Exception:
     44#               ctx.fatal("Version check failed please report")
     45
     46        if ver < minver:
     47                ctx.fatal("Sphinx version is too old: %s" % ".".join(map(str, ver)))
     48
     49        return ver
     50
    3551def cmd_configure(ctx):
    3652        ctx.load('tex')
     53
    3754
    3855        if not ctx.env.PDFLATEX:
     
    4057
    4158        ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory=True)
    42 #       ctx.find_program("pdflatex", var="BIN_PDFLATEX", mandatory=True)
    4359        ctx.find_program("aspell", var="BIN_ASPELL", mandatory=False)
     60
     61
     62        ctx.start_msg("Checking if Sphinx is at least %s.%s" % sphinx_min_version)
     63        ver = check_sphinx_version(ctx, sphinx_min_version)
     64
     65        ctx.end_msg("yes (%s)" % ".".join(map(str, ver)))
     66
    4467
    4568
Note: See TracChangeset for help on using the changeset viewer.