From 4e40340318f8e35a81cc3281b188f2ebac1b531d Mon Sep 17 00:00:00 2001 From: Bartosz Nitka Date: Sat, 24 Oct 2015 02:12:16 +0200 Subject: Support more sphinx-build versions in configure script `sphinx-build` on CentOS (`python-sphinx10-doc-1.0.8-1.el6.centos.noarch`) responds with this on `stderr`: ``` $ sphinx-1.0-build --version Sphinx v1.0.8 Usage: /usr/bin/sphinx-1.0-build [options] sourcedir outdir [filenames...] Options: -b -- builder to use; default is html -a -- write all files; default is to only write new and changed files ... Modi: * without -a and without filenames, write new and changed files. * with -a, write all files. * with filenames, write these. ``` This should make it work for the old and the new format. Test Plan: ``` $ echo "Sphinx (sphinx-build) 1.0.1" | sed 's/Sphinx\( (sphinx-build)\)\? v\?\([0-9]\.[0-9]\.[0-9]\)/\2/' 1.0.1 $ echo "Sphinx v1.0.1" | sed 's/Sphinx\( (sphinx-build)\)\? v\?\([0-9]\.[0-9]\.[0-9]\)/\2/' 1.0.1 ``` Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1361 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 925846a3a9..dabcbcd78a 100644 --- a/configure.ac +++ b/configure.ac @@ -775,7 +775,7 @@ AC_PATH_PROG(SPHINXBUILD,sphinx-build) AC_CACHE_CHECK([for version of sphinx-build], sphinx_version, changequote(, )dnl [if test -n "$SPHINXBUILD"; then - sphinx_version=`"$SPHINXBUILD" --version | sed 's/Sphinx (sphinx-build) \([0-9]\.[0-9]\.[0-9]\)/\1/'`; + sphinx_version=`"$SPHINXBUILD" --version 2>&1 | sed 's/Sphinx\( (sphinx-build)\)\? v\?\([0-9]\.[0-9]\.[0-9]\)/\2/' | head -n1`; fi; changequote([, ])dnl ]) -- cgit v1.2.1