ctdb-build: Split dist() target to generate manpages separately
authorAmitay Isaacs <amitay@gmail.com>
Tue, 21 Feb 2017 11:30:30 +0000 (22:30 +1100)
committerMartin Schwenke <martins@samba.org>
Thu, 23 Feb 2017 14:31:08 +0000 (15:31 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/wscript

index 02331499636d64e775dbc9dd2a56c8f63805972e..78319ecd1adf9a630297303542a4236eaa9f11b4 100644 (file)
@@ -957,7 +957,27 @@ def show_version(ctx):
     print VERSION
 
 
-def dist():
+def manpages(ctx):
+    BASE_URL = 'http://docbook.sourceforge.net/release/xsl/current'
+    MAN_XSL = '%s/manpages/docbook.xsl' % BASE_URL
+    HTML_XSL = '%s/html/docbook.xsl' % BASE_URL
+    CMD_TEMPLATE = 'xsltproc --xinclude -o %s --nonet %s %s'
+    manpages = manpages_binary + manpages_misc + manpages_etcd + manpages_ceph
+    for t in manpages:
+        cmd = CMD_TEMPLATE % ('doc/%s' % t, MAN_XSL, 'doc/%s.xml' % t)
+        ret = samba_utils.RUN_COMMAND(cmd)
+        if ret != 0:
+            print('Command %s failed with exit status %d' % (cmd, ret))
+            sys.exit(ret)
+
+        cmd = CMD_TEMPLATE % ('doc/%s.html' % t, HTML_XSL, 'doc/%s.xml' % t)
+        ret = samba_utils.RUN_COMMAND(cmd)
+        if ret != 0:
+            print('Command %s failed with exit status %d' % (cmd, ret))
+            sys.exit(ret)
+
+
+def distonly(ctx):
     samba_dist.DIST_FILES('VERSION:VERSION', extend=True)
 
     t = 'include/ctdb_version.h'
@@ -979,24 +999,8 @@ def dist():
         sys.exit(ret)
     samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True)
 
-    BASE_URL = 'http://docbook.sourceforge.net/release/xsl/current'
-    MAN_XSL = '%s/manpages/docbook.xsl' % BASE_URL
-    HTML_XSL = '%s/html/docbook.xsl' % BASE_URL
-    CMD_TEMPLATE = 'xsltproc --xinclude -o %s --nonet %s %s'
     manpages = manpages_binary + manpages_misc + manpages_etcd + manpages_ceph
     for t in manpages:
-        cmd = CMD_TEMPLATE % ('doc/%s' % t, MAN_XSL, 'doc/%s.xml' % t)
-        ret = samba_utils.RUN_COMMAND(cmd)
-        if ret != 0:
-            print('Command %s failed with exit status %d' % (cmd, ret))
-            sys.exit(ret)
-
-        cmd = CMD_TEMPLATE % ('doc/%s.html' % t, HTML_XSL, 'doc/%s.xml' % t)
-        ret = samba_utils.RUN_COMMAND(cmd)
-        if ret != 0:
-            print('Command %s failed with exit status %d' % (cmd, ret))
-            sys.exit(ret)
-
         samba_dist.DIST_FILES('ctdb/doc/%s:doc/%s' % (t, t), extend=True)
         samba_dist.DIST_FILES('ctdb/doc/%s.html:doc/%s.html' % (t, t),
                               extend=True)
@@ -1004,6 +1008,12 @@ def dist():
     samba_dist.dist()
 
 
+def dist():
+    import Scripting
+    Scripting.commands.append('manpages')
+    Scripting.commands.append('distonly')
+
+
 def rpmonly(ctx):
     opts = os.getenv('RPM_OPTIONS') or ''
     cmd = 'rpmbuild -ta --clean --rmsource %s ctdb-%s.tar.gz' % (opts, VERSION)