X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=buildtools%2Fcall-sphinx-build.py;h=39a60d09fa419f0c3df12b9de2a40d7263078b3c;hb=4c85b3e2e1e3ddb4b9352ee83dde167a7ffd8353;hp=0dce59f64109d9ed10891319ee7c4476e391aa5c;hpb=e5feab93a91339e1204e2e9e1b9ab40e252d4c80;p=dpdk.git diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py index 0dce59f641..39a60d09fa 100755 --- a/buildtools/call-sphinx-build.py +++ b/buildtools/call-sphinx-build.py @@ -7,9 +7,10 @@ import sys import os from os.path import join from subprocess import run, PIPE, STDOUT -from distutils.version import StrictVersion +from packaging.version import Version -(sphinx, version, src, dst) = sys.argv[1:] # assign parameters to variables +# assign parameters to variables +(sphinx, version, src, dst, *extra_args) = sys.argv[1:] # set the version in environment for sphinx to pick up os.environ['DPDK_VERSION'] = version @@ -17,8 +18,8 @@ os.environ['DPDK_VERSION'] = version # for sphinx version >= 1.7 add parallelism using "-j auto" ver = run([sphinx, '--version'], stdout=PIPE, stderr=STDOUT).stdout.decode().split()[-1] -sphinx_cmd = [sphinx] -if StrictVersion(ver) >= StrictVersion('1.7'): +sphinx_cmd = [sphinx] + extra_args +if Version(ver) >= Version('1.7'): sphinx_cmd += ['-j', 'auto'] # find all the files sphinx will process so we can write them as dependencies @@ -29,9 +30,10 @@ for root, dirs, files in os.walk(src): # run sphinx, putting the html output in a "html" directory with open(join(dst, 'sphinx_html.out'), 'w') as out: process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')], - check=True, stdout=out) # create a gcc format .d file giving all the dependencies of this doc build with open(join(dst, '.html.d'), 'w') as d: d.write('html: ' + ' '.join(srcfiles) + '\n') + +sys.exit(process.returncode)