build: Allow &pathconfig XML entities to be used in all manpages, not just smb.conf
authorAndrew Bartlett <abartlet@samba.org>
Mon, 20 Jun 2022 02:34:05 +0000 (14:34 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 22 Jun 2022 15:50:33 +0000 (15:50 +0000)
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>
buildtools/wafsamba/wafsamba.py
docs-xml/build/DTD/samba-doc
docs-xml/wscript_build

index 79fe8b5e5758aab34a07ed215a57c2ce76b10e2c..063f9d2ed758d72178a4bce794aaa2919caa3c02 100644 (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,
index 9873aa03458609dfe3f423266d00ce414d779357..e4a5278925749e2a3ff5bd09ecb32314932f202a 100644 (file)
        "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)*)>
index c8c4b68e514ec52e873df66c870da1bc378c3638..40f55141ad84d862d888a6eca976df1619b3add2 100644 (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)