chiark / gitweb /
documentation/doxygen: adapt to different \dotfile handling in 1.9.3.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 10 Jan 2022 17:40:58 +0000 (18:40 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 10 Jan 2022 20:04:13 +0000 (21:04 +0100)
documentation/doxygen.py

index f2b74dc7c41327ded814d73632719f3ef8f61f1b..d293940ea73dd151b41f1a2a8a67808cc56ce61d 100755 (executable)
@@ -1052,7 +1052,12 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
             caption = None
             if i.tag == 'dotfile':
                 if 'name' in i.attrib:
-                    with open(i.attrib['name'], 'r') as f:
+                    # Since 1.9.3, the file is copied to the XML output
+                    # directory and name contains its relative path. Before
+                    # that, the name was absolute, os.path.join() should do the
+                    # right thing in both cases.
+                    path = os.path.join(state.basedir, state.doxyfile['OUTPUT_DIRECTORY'], state.doxyfile['XML_OUTPUT'], i.attrib['name'])
+                    with open(path, 'r') as f:
                         source = f.read()
                 # Since 1.8.16 the whole <dotfile> tag is dropped if the file
                 # doesn't exist. Such a great solution that it's unfathomable.