summaryrefslogtreecommitdiffstats
path: root/doc/SConscript
diff options
context:
space:
mode:
authoranatoly techtonik <techtonik@gmail.com>2015-01-11 13:55:09 (GMT)
committeranatoly techtonik <techtonik@gmail.com>2015-01-11 13:55:09 (GMT)
commite66ff66fb442cfa4aecdb717a2bd1c9537f2e3c3 (patch)
treef09835022231a4297b33d8dfe3c12236c1ec0a8b /doc/SConscript
parent2e17a095249dafe84d63309bf5a03b8a9b4961a7 (diff)
downloadSCons-e66ff66fb442cfa4aecdb717a2bd1c9537f2e3c3.zip
SCons-e66ff66fb442cfa4aecdb717a2bd1c9537f2e3c3.tar.gz
SCons-e66ff66fb442cfa4aecdb717a2bd1c9537f2e3c3.tar.bz2
doc/SConscript: Fix build crash when XML toolchain is not installed
by intercepting previously added ImportError from SConsDoc
Diffstat (limited to 'doc/SConscript')
-rw-r--r--doc/SConscript55
1 files changed, 29 insertions, 26 deletions
diff --git a/doc/SConscript b/doc/SConscript
index 7880ba3..6b87f6f 100644
--- a/doc/SConscript
+++ b/doc/SConscript
@@ -28,25 +28,43 @@ import os.path
import re
import sys
import glob
-import SConsDoc
-import SConsExamples
+
import bootstrap
Import('build_dir', 'env', 'whereis', 'revaction')
-env = env.Clone()
+#
+# -- Check prerequisites for building the documentation ---
+#
+skip_doc = False
-build = os.path.join(build_dir, 'doc')
+try:
+ import SConsDoc
+ import SConsExamples
+except ImportError as exc:
+ print("doc: SConsDoc failed to import, the error was:")
+ print(" ImportError: %s" % exc)
+ print(" Please make sure that python-libxml2 or python-lxml is installed.")
+ skip_doc = True
fop = whereis('fop')
xep = whereis('xep')
+
+if not fop and not xep:
+ print "doc: No PDF renderer found (fop|xep)!"
+ skip_doc = True
+
+#
+# --- Configure build
+#
+env = env.Clone()
+
+build = os.path.join(build_dir, 'doc')
+
epydoc_cli = whereis('epydoc')
gs = whereis('gs')
lynx = whereis('lynx')
-#
-#
-#
dist_doc_tar_gz = '$DISTDIR/scons-doc-${VERSION}.tar.gz'
tar_deps = []
@@ -55,7 +73,9 @@ tar_list = []
orig_env = env
env = orig_env.Clone(SCONS_PY = File('#src/script/scons.py').rfile())
-
+#
+# --- Helpers ---
+#
def writeVersionXml(verfile, date, ver, rev):
""" Helper function: Write a version.xml file. """
try:
@@ -76,25 +96,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT.
""" % (date, ver, rev))
#
-# Check whether we have all tools installed for
-# building the documentation.
+# --- Processing ---
#
-skip_doc = False
-try:
- import libxml2
- import libxslt
-except:
- try:
- import lxml
- except:
- print "doc: Neither libxml2 nor lxml Python bindings found!"
- print " Please install one of the packages python-libxml2 or python-lxml."
- skip_doc = True
-
-if not fop and not xep:
- print "doc: No PDF renderer found (fop|xep)!"
- skip_doc = True
-
if skip_doc:
print "doc: ...skipping building User Guide."
else: