system wide detection does not work on debian
On Debian 7.0, detection of the system-wide sphinx version fails.
This is for two reasons:
$ sphinx-build --versionoutputs the help after the version
- The output is made to stderr, not stdout. The exec() call does not catch that. One can catch it by appending
2>&1to the command, which redirecty stderr to stdout.
$ /usr/bin/sphinx-build --version Sphinx v1.1.3 Usage: /usr/bin/sphinx-build [options] sourcedir outdir [filenames...] Options: -b <builder> -- builder to use; default is html -a -- write all files; default is to only write new and changed files -E -- don't use a saved environment, always read all files -t <tag> -- include "only" blocks with <tag> -d <path> -- path for the cached environment and doctree files (default: outdir/.doctrees) -c <path> -- path where configuration file (conf.py) is located (default: same as sourcedir) -C -- use no config file at all, only -D options -D <setting=value> -- override a setting in configuration -A <name=value> -- pass a value into the templates, for HTML builder -n -- nit-picky mode, warn about all missing references -N -- do not do colored output -q -- no output on stdout, just warnings on stderr -Q -- no output at all, not even warnings -w <file> -- write warnings (and errors) to given file -W -- turn warnings into errors -P -- run Pdb on exception Modi: * without -a and without filenames, write new and changed files. * with -a, write all files. * with filenames, write these.