X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=buildtools%2Fcall-sphinx-build.py;h=26b199220a15780ff50480fe95befd35ceaba8d6;hb=1b593b9c832e9b284cc59665fe662242a3fc1daf;hp=b9a3994e1799e8df2a28ecd092a9d8f3f80e464c;hpb=f5ab2074cfba1fa9287269aec08358c29799bc13;p=dpdk.git diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py index b9a3994e17..26b199220a 100755 --- a/buildtools/call-sphinx-build.py +++ b/buildtools/call-sphinx-build.py @@ -6,14 +6,19 @@ import sys import os from os.path import join -from subprocess import run, PIPE +from subprocess import run, PIPE, STDOUT from distutils.version import StrictVersion -(sphinx, 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 # for sphinx version >= 1.7 add parallelism using "-j auto" -ver = run([sphinx, '--version'], stdout=PIPE).stdout.decode().split()[-1] -sphinx_cmd = [sphinx] +ver = run([sphinx, '--version'], stdout=PIPE, + stderr=STDOUT).stdout.decode().split()[-1] +sphinx_cmd = [sphinx] + extra_args if StrictVersion(ver) >= StrictVersion('1.7'): sphinx_cmd += ['-j', 'auto'] @@ -23,9 +28,12 @@ for root, dirs, files in os.walk(src): srcfiles.extend([join(root, f) for f in files]) # run sphinx, putting the html output in a "html" directory -process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')], check=True) -print(str(process.args) + ' Done OK') +with open(join(dst, 'sphinx_html.out'), 'w') as out: + process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')], + 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)