[commit: ghc] master: Support more sphinx-build versions in configure script (4e40340)

git at git.haskell.org git at git.haskell.org
Sat Oct 24 00:10:00 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4e40340318f8e35a81cc3281b188f2ebac1b531d/ghc

>---------------------------------------------------------------

commit 4e40340318f8e35a81cc3281b188f2ebac1b531d
Author: Bartosz Nitka <niteria at gmail.com>
Date:   Sat Oct 24 02:12:16 2015 +0200

    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> -- 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


>---------------------------------------------------------------

4e40340318f8e35a81cc3281b188f2ebac1b531d
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 925846a..dabcbcd 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
 ])



More information about the ghc-commits mailing list