git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/vmxnet3: support RETA query and update
[dpdk.git]
/
buildtools
/
call-sphinx-build.py
diff --git
a/buildtools/call-sphinx-build.py
b/buildtools/call-sphinx-build.py
index
85c9e01
..
39a60d0
100755
(executable)
--- a/
buildtools/call-sphinx-build.py
+++ b/
buildtools/call-sphinx-build.py
@@
-7,15
+7,19
@@
import sys
import os
from os.path import join
from subprocess import run, PIPE, STDOUT
import os
from os.path import join
from subprocess import run, PIPE, STDOUT
-from
distutils.version import Strict
Version
+from
packaging.version import
Version
-(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,
stderr=STDOUT).stdout.decode().split()[-1]
# 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) >= Strict
Version('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
sphinx_cmd += ['-j', 'auto']
# find all the files sphinx will process so we can write them as dependencies
@@
-24,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
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')
# 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)