Add patch to fix reproducible doc builds
[deb_dpdk.git] / debian / patches / 0001-doc-fix-garbage-text-in-generated-HTML-guides.patch
1 Description: doc: fix garbage text in generated HTML guides
2  If the user has MAKEFLAGS set in the environment when building the
3  documentation, the doc/guides/conf.py script which calls "make"
4  exclusively to get the project version might pick up garbage from
5  stdout, like:
6  <title>FAQ &mdash; Data Plane Development Kit make[2]:
7  Entering directory &#39;/build/1st/dpdk-18.11/doc/guides&#39;
8  18.11.0
9  make[2]: Leaving directory &#39;/build/1st/dpdk-18.11&#39;
10  documentation</title>
11  Override MAKEFLAGS in the Python subprocess call to avoid this issue.
12 Author: bluca@debian.org
13 Forwarded: https://patches.dpdk.org/patch/48544/
14 --- a/doc/guides/conf.py
15 +++ b/doc/guides/conf.py
16 @@ -9,6 +9,7 @@ from sphinx import __version__ as sphinx
17  from sphinx.highlighting import PygmentsBridge
18  from pygments.formatters.latex import LatexFormatter
19  from os import listdir
20 +from os import environ
21  from os.path import basename
22  from os.path import dirname
23  from os.path import join as path_join
24 @@ -37,7 +38,9 @@ html_add_permalinks = ""
25  html_show_copyright = False
26  highlight_language = 'none'
27  
28 -version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion'])
29 +# If MAKEFLAGS is exported by the user, garbage text might end up in version
30 +version = subprocess.check_output(['make', '-sRrC', '../../', 'showversion'],
31 +                                  env=dict(environ, MAKEFLAGS=""))
32  version = version.decode('utf-8').rstrip()
33  release = version
34