tools: ignore root element explicitly in check-version-history

Currently these messages (broken for length)

    2025-08-20T12:04:15.9609277Z
    /home/runner/work/systemd/systemd/tools/check-version-history.py:26:
    FutureWarning: This search incorrectly ignores the root element, and will be fixed in a future version.
    If you rely on the current behaviour, change it to './/funcprototype/funcdef/function'

can be seen in CI output. So let's apply the suggestion.
This commit is contained in:
Jörg Behrmann
2025-08-20 15:47:28 +02:00
parent 09a89190bb
commit 1dcbb0b4ca

View File

@@ -23,7 +23,7 @@ def find_undocumented_functions(pages, ignorelist):
assert pagetree.getroot().tag == "refentry"
hist_section = pagetree.find("refsect1[title='History']")
for func in pagetree.findall("//funcprototype/funcdef/function"):
for func in pagetree.findall(".//funcprototype/funcdef/function"):
path = f"./refsynopsisdiv/funcsynopsis/funcprototype/funcdef/function[.='{func.text}']"
assert pagetree.findall(path) == [func]