summaryrefslogtreecommitdiff
path: root/bin/docs-update-generated.py
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2020-03-31 09:10:54 -0600
committerMats Wichmann <mats@linux.com>2020-03-31 10:09:35 -0600
commit8053e4f154a8bbe1df85a431251a0636a45a4f5d (patch)
tree27765941855611d405664b1e4907cd9b50d6fb19 /bin/docs-update-generated.py
parent70808bf820a49cb3cf443288083c1e7b3800bba4 (diff)
downloadscons-git-8053e4f154a8bbe1df85a431251a0636a45a4f5d.tar.gz
Fix generated tools doc intermediate file. [ci skip]
The process to generate tools.gen writes entities for links to construction variables used/set by each tool. When this data is written out using lxml's tostring() method, this is encoded, causing &foo; to become &amp;foo; which then doesn't work in later processing as these files are included, as they're no longer valid entity references for substitution. This seems really hard to fix directly, because tostring() is working as documented by doing this, so for now - maybe forever in light of thoughts of converting docs to a different format - just postprocess the file to undo the damage. A hack, but fixes #3580 Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'bin/docs-update-generated.py')
-rw-r--r--bin/docs-update-generated.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/bin/docs-update-generated.py b/bin/docs-update-generated.py
index 52ebb0a2e..98c923df1 100644
--- a/bin/docs-update-generated.py
+++ b/bin/docs-update-generated.py
@@ -43,13 +43,21 @@ def generate_all():
print("Couldn't create destination folder %s! Exiting..." % gen_folder)
return
# Call scons-proc.py
- _ = subprocess.call([sys.executable,
- os.path.join('bin','scons-proc.py'),
- '-b', argpair('builders'),
- '-f', argpair('functions'),
- '-t', argpair('tools'),
- '-v', argpair('variables')] + flist,
- shell=False)
+ cp = subprocess.run([sys.executable,
+ os.path.join('bin','scons-proc.py'),
+ '-b', argpair('builders'),
+ '-f', argpair('functions'),
+ '-t', argpair('tools'),
+ '-v', argpair('variables')] + flist,
+ shell=False)
+
+ cp.check_returncode() # bail if it failed
+ # lxml: fixup possibly broken tools.gen:
+ with open(os.path.join(gen_folder, 'tools.gen'), 'r') as f :
+ filedata = f.read()
+ filedata = filedata.replace(r'&amp;cv-link', r'&cv-link')
+ with open(os.path.join(gen_folder, 'tools.gen'), 'w') as f :
+ f.write(filedata)
if __name__ == "__main__":