1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
8 def detectXsltVersion(fpath
):
9 """ Return a tuple with the version of the Docbook XSLT stylesheets,
10 or (0, 0, 0) if no stylesheets are installed or the VERSION
11 file couldn't be found/parsed correctly.
13 with
open(os
.path
.join(fpath
, 'VERSION'), 'rb') as fin
:
14 re_version
= re
.compile(b
"<fm:Version>([^<]+)</fm:Version>")
15 m
= re_version
.search(fin
.read())
18 return tuple(map(int, m
.group(1).split(b
'.')))