From f3de9f6c2e004caab3c410b70c9a7424d5dc8627 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 20 Jun 2022 14:34:05 +1200 Subject: [PATCH] build: Allow &pathconfig XML entities to be used in all manpages, not just smb.conf BUG: https://bugzilla.samba.org/show_bug.cgi?id=15101 Signed-off-by: Andrew Bartlett Reviewed-by: Andreas Schneider --- buildtools/wafsamba/wafsamba.py | 4 ++-- docs-xml/build/DTD/samba-doc | 5 +++++ docs-xml/wscript_build | 36 ++++++++++++++++++++++++++------- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 79fe8b5e575..063f9d2ed75 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -1180,10 +1180,10 @@ def SAMBAMANPAGES(bld, manpages, extra_source=None): source = [m + '.xml'] if extra_source is not None: source = [source, extra_source] - # ${SRC[1]} and ${SRC[2]} are not referenced in the + # ${SRC[1]}, ${SRC[2]} and ${SRC[3]} are not referenced in the # SAMBA_GENERATOR but trigger the dependency calculation so # ensures that manpages are rebuilt when these change. - source += ['build/DTD/samba.entities', 'build/DTD/samba.build.version'] + source += ['build/DTD/samba.build.pathconfig', 'build/DTD/samba.entities', 'build/DTD/samba.build.version'] bld.SAMBA_GENERATOR(m, source=source, target=m, diff --git a/docs-xml/build/DTD/samba-doc b/docs-xml/build/DTD/samba-doc index 9873aa03458..e4a52789257 100644 --- a/docs-xml/build/DTD/samba-doc +++ b/docs-xml/build/DTD/samba-doc @@ -28,6 +28,11 @@ "http://www.samba.org/samba/LOCAL.BUILDDIR.DTD/samba.build.version"> %samba.build.version; + +%samba.build.pathconfig; + diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build index c8c4b68e514..40f55141ad8 100644 --- a/docs-xml/wscript_build +++ b/docs-xml/wscript_build @@ -116,10 +116,7 @@ vfs_module_manpages = ['vfs_acl_tdb', 'vfs_xattr_tdb', 'vfs_zfsacl' ] -def smbdotconf_generate_parameter_list(task): - parameter_all = task.outputs[0].bldpath(task.env) - articles = task.inputs - +def generate_path_entity_list(): entities = bld.pathconfig_entities() # We need this if we build with Heimdal as we can't easily make @@ -129,15 +126,24 @@ def smbdotconf_generate_parameter_list(task): if bld.CONFIG_SET('MIT_KDC_PATH'): mit_kdc_path = bld.CONFIG_GET('MIT_KDC_PATH') - t = "\n" +\ + "\n" + return t + +def smbdotconf_generate_parameter_list_file(task): + parameter_all = task.outputs[0].bldpath(task.env) + articles = task.inputs + + t = "\n" +\ "
\n" +\ "".join(art.read() for art in articles) +\ "
\n" + save_file(parameter_all, t , create_dir=True) return 0 @@ -152,9 +158,25 @@ articles = " ".join(sorted([x.path_from(bld.path) for x in sources], bld.SAMBA_GENERATOR(parameter_all, source=articles, target=parameter_all, - rule=smbdotconf_generate_parameter_list, + rule=smbdotconf_generate_parameter_list_file) + +def generate_path_entity_file(task): + path_entities_file = task.outputs[0].bldpath(task.env) + + save_file(path_entities_file, + generate_path_entity_list(), + create_dir=True) + return 0 + +path_entities = 'build/DTD/samba.build.pathconfig' + +bld.SAMBA_GENERATOR(path_entities, + source=articles, + target=path_entities, + rule=generate_path_entity_file, dep_vars=bld.dynconfig_varnames()) + def SMBDOTCONF_MANPAGE(bld, target): ''' assemble and build smb.conf.5 manual page''' bld.SAMBAMANPAGES(target, parameter_all)