Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: kernel_feat.py: add build dependencies

Ensure that the feature files will be regenerated if any
changes happen at the Documentation/features files that were
processed by gen_feat.pl.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lore.kernel.org/r/5cdf7a8300019129dcc09d4c2557f75908754445.1648290305.git.mchehab@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
85999f03 01096e5c

+18 -2
+18 -2
Documentation/sphinx/kernel_feat.py
··· 33 33 34 34 import codecs 35 35 import os 36 + import re 36 37 import subprocess 37 38 import sys 38 39 ··· 83 82 84 83 env = doc.settings.env 85 84 cwd = path.dirname(doc.current_source) 86 - cmd = "get_feat.pl rest --dir " 85 + cmd = "get_feat.pl rest --enable-fname --dir " 87 86 cmd += self.arguments[0] 88 87 89 88 if len(self.arguments) > 1: ··· 103 102 shell_env["srctree"] = srctree 104 103 105 104 lines = self.runCmd(cmd, shell=True, cwd=cwd, env=shell_env) 106 - nodeList = self.nestedParse(lines, fname) 105 + 106 + line_regex = re.compile("^\.\. FILE (\S+)$") 107 + 108 + out_lines = "" 109 + 110 + for line in lines.split("\n"): 111 + match = line_regex.search(line) 112 + if match: 113 + fname = match.group(1) 114 + 115 + # Add the file to Sphinx build dependencies 116 + env.note_dependency(os.path.abspath(fname)) 117 + else: 118 + out_lines += line + "\n" 119 + 120 + nodeList = self.nestedParse(out_lines, fname) 107 121 return nodeList 108 122 109 123 def runCmd(self, cmd, **kwargs):