ctdb-build: Don't try to install unavailable prebuilt manpages
authorMartin Schwenke <martin@meltin.net>
Mon, 9 Nov 2015 23:14:56 +0000 (10:14 +1100)
committerAmitay Isaacs <amitay@samba.org>
Wed, 11 Nov 2015 05:23:48 +0000 (06:23 +0100)
Commit 3ddd35142ab86de431d00f93de2fb6a2b371317d tries to
unconditionally install pre-built manpages if xsltproc is unavailable.
However, these only exist in a tarball, not in a git repo.  That can
make the installation fail.

If xsltproc does not exist then check for each pre-built manpage at
configure time.  This should cover all the possible cases.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Nov 11 06:23:48 CET 2015 on sn-devel-104

ctdb/wscript

index b720748b4737ae5f2c7edacfa4290c47e3ef7d14..cea9e42a49ca84d1a2f9ebe0c4b3a3cce18593ed 100755 (executable)
@@ -227,6 +227,19 @@ def configure(conf):
         conf.DEFINE('SAMBA_UTIL_CORE_ONLY', 1, add_to_cflags=True)
         conf.SAMBA_CONFIG_H()
 
+    if 'XSLTPROC_MANPAGES' in conf.env and conf.env['XSLTPROC_MANPAGES']:
+        conf.env.ctdb_generate_manpages = True
+    else:
+        conf.env.ctdb_generate_manpages = False
+
+        Logs.info("xsltproc unavailable, checking for pre-built manpages")
+        conf.env.ctdb_prebuilt_manpages = []
+        for m in manpages:
+            if os.path.exists(os.path.join("doc", m)):
+                Logs.info("  %s: yes" % (m))
+                conf.env.ctdb_prebuilt_manpages.append(m)
+            else:
+                Logs.info("  %s: no" % (m))
 
 def build(bld):
     if bld.env.standalone_ctdb:
@@ -493,12 +506,12 @@ def build(bld):
                             target=x,
                             rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
 
-    if 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
+    if bld.env.ctdb_generate_manpages:
         bld.MANPAGES('''onnode.1 ctdbd_wrapper.1 ctdbd.conf.5
                         ctdb.7 ctdb-statistics.7 ctdb-tunables.7''',
                       True)
     else:
-        for m in manpages:
+        for m in bld.env.ctdb_prebuilt_manpages:
             bld.SAMBA_GENERATOR(m,
                                 source=os.path.join("doc", m),
                                 target=m,