docs: only add configuration files to sitemap once generated

The generation script can fail to generate a configuration for the four
libraries where the documentation is not generated from gir, as it needs
to run pkg-config.

Only add the path to the configuration file to the sitemap once it has
successfully been dumped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8324>
This commit is contained in:
Mathieu Duponchelle 2025-01-20 13:20:17 +01:00
parent 29098aeba8
commit 45c4c6d7ed

View file

@ -155,7 +155,6 @@ class GstLibsHotdocConfGen:
project_name = PROJECT_NAME_MAP.get(libname, libname)
conf_path = self.builddir / f'{project_name}-doc.json'
conf_files.append(str(conf_path))
index_path = os.path.join(self.source_root, 'index.md')
if not os.path.exists(index_path):
@ -171,7 +170,6 @@ class GstLibsHotdocConfGen:
if not os.path.exists(c_index_path):
c_index_path = index_path
try:
if libname == 'adaptivedemux':
c_flags = get_c_flags(f'gstreamer-base-{self.project_version}', self.buildroot)
@ -216,6 +214,8 @@ class GstLibsHotdocConfGen:
with conf_path.open('w') as f:
json.dump(conf, f, indent=4)
conf_files.append(str(conf_path))
if self.output is not None:
with self.output.open('w') as f: