[PATCH] assorted fixes to man page generator
Alexander Bokovoy
ab at samba.org
Fri Oct 6 19:55:24 UTC 2017
Hi,
Please review and push.
--
/ Alexander Bokovoy
-------------- next part --------------
>From 0505ac017c9d0a2f270c1bf91781b98e5590403e Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <ab at samba.org>
Date: Fri, 6 Oct 2017 22:49:11 +0300
Subject: [PATCH 1/2] smb.conf.5: sort parameters alphabetically
Content of each separate parameter description file is added
into a parameters.all.xml file before compiling smb.conf.5.
The issue is that POSIX file systems generally don't give any
promises over how glob-produced files are sorted. Thus, we need to sort
them in a predictable way.
This patch adds sorting based on a file name as a string. Since all
parameter files named after the parameter itself (plus .xml), we can
use file name sorting.
Signed-off-by: Alexander Bokovoy <ab at samba.org>
---
docs-xml/wscript_build | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index e329ad40295..5b4585e13d8 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -1,5 +1,6 @@
#!/usr/bin/env python
from samba_utils import save_file
+import os
manpages='''
manpages/cifsdd.8
manpages/dbwrap_tool.1
@@ -131,7 +132,11 @@ def smbdotconf_generate_parameter_list(task):
save_file(parameter_all, t , create_dir=True)
return 0
-articles = bld.path.ant_glob("smbdotconf/**/*.xml", flat=True)
+# Since nothing really forces sorting in glob, we have to sort by file name
+sources = bld.path.ant_glob("smbdotconf/**/*.xml", flat=False)
+articles = " ".join(sorted([x.relpath_gen(bld.path) for x in sources],
+ key=lambda m: m.split(os.sep)[-1]))
+
parameter_all = 'smbdotconf/parameters.all.xml'
bld.SAMBA_GENERATOR(parameter_all,
source=articles,
--
2.13.6
>From b4f75082d642691aa668c970627f7586c5b5facb Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <ab at samba.org>
Date: Fri, 6 Oct 2017 22:52:36 +0300
Subject: [PATCH 2/2] man pages: properly ident lists
It took me some time but now lists in smb.conf.5 are properly idented.
Signed-Off-By: Alexander Bokovoy <ab at samba.org>
---
docs-xml/xslt/man.xsl | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs-xml/xslt/man.xsl b/docs-xml/xslt/man.xsl
index d9cc1def72c..e252b56d5e5 100644
--- a/docs-xml/xslt/man.xsl
+++ b/docs-xml/xslt/man.xsl
@@ -43,6 +43,7 @@
<!-- * content (if any) before getting the list items -->
<xsl:apply-templates
select="*[not(self::listitem) and not(self::title)]"/>
+ <xsl:text>
.RS
</xsl:text>
<xsl:apply-templates select="listitem"/>
<xsl:if test="(parent::para or parent::listitem) or following-sibling::node()">
<xsl:text>.sp
</xsl:text>
--
2.13.6
More information about the samba-technical
mailing list