1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Andrew Bartlett 2022-06-20 14:34:05 +12:00 committed by Andreas Schneider
parent f68374aac5
commit f3de9f6c2e
3 changed files with 36 additions and 9 deletions

View File

@ -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,

View File

@ -28,6 +28,11 @@
"http://www.samba.org/samba/LOCAL.BUILDDIR.DTD/samba.build.version">
%samba.build.version;
<!ENTITY % samba.build.pathconfig PUBLIC
"-//Samba-Team//VERSION Samba Build Version//EN"
"http://www.samba.org/samba/LOCAL.BUILDDIR.DTD/samba.build.pathconfig">
%samba.build.pathconfig;
<!-- smb.conf options -->
<!ELEMENT smbconfblock ((smbconfoption|smbconfsection|smbconfcomment)*)>

View File

@ -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 = "<!DOCTYPE section [\n" +\
"\n".join(entities) +\
t = "\n".join(entities) +\
"\n" +\
"<!ENTITY pathconfig.MITKDCPATH " + mit_kdc_path + ">\n" +\
"\n"
return t
def smbdotconf_generate_parameter_list_file(task):
parameter_all = task.outputs[0].bldpath(task.env)
articles = task.inputs
t = "<!DOCTYPE section [\n" +\
generate_path_entity_list() + \
"]>\n" +\
"<section>\n" +\
"".join(art.read() for art in articles) +\
"</section>\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)