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

Configure Feed

Select the types of activity you want to include in your feed.

scripts/get_abi.pl: add support to parse ABI README file

The Documentation/ABI/README file is currently outside the
documentation tree. Yet, it may still provide some useful
information. Add it to the documentation parsing.

As a plus, this avoids a warning when detecting missing
cross-references.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/f1285dedfe4d0eb0f0af34f6a68bee6fde36dd7d.1739182025.git.mchehab+huawei@kernel.org

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
98a4324a 2a21d80d

+20 -5
+20 -5
scripts/lib/abi/abi_parser.py
··· 263 263 if content: 264 264 self.warn(fdata, "Unexpected content", line) 265 265 266 + def parse_readme(self, nametag, fname): 267 + """Parse ABI README file""" 268 + 269 + with open(fname, "r", encoding="utf8", errors="backslashreplace") as fp: 270 + nametag["description"] = "```\n" 271 + for line in fp: 272 + nametag["description"] += " " + line 273 + 274 + nametag["description"] += "```\n" 275 + 266 276 def parse_file(self, fname, path, basename): 267 277 """Parse a single file""" 268 278 ··· 319 309 if self.debug & AbiDebug.WHAT_OPEN: 320 310 self.log.debug("Opening file %s", fname) 321 311 312 + if basename == "README": 313 + self.parse_readme(fdata.nametag, fname) 314 + return 315 + 322 316 with open(fname, "r", encoding="utf8", errors="backslashreplace") as fp: 323 317 for line in fp: 324 318 fdata.ln += 1 ··· 357 343 continue 358 344 359 345 basename = os.path.basename(name) 360 - 361 - if basename == "README": 362 - continue 363 346 364 347 if basename.startswith("."): 365 348 continue ··· 459 448 continue 460 449 461 450 if filter_path: 462 - if v.get("path") != filter_path: 463 - continue 451 + if filter_path == "README": 452 + if not names[0].endswith("README"): 453 + continue 454 + else: 455 + if v.get("path") != filter_path: 456 + continue 464 457 465 458 msg = "" 466 459