trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gan...@apache.org
Subject [trafficserver] branch master updated: Fixed broken sphinx version check on MacOS
Date Sat, 14 Jul 2018 05:05:27 GMT
This is an automated email from the ASF dual-hosted git repository.

gancho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 441f5f6  Fixed broken sphinx version check on MacOS
441f5f6 is described below

commit 441f5f6203079a457dea1fef40c775118eaef2c2
Author: Gancho Tenev <gancho@apache.org>
AuthorDate: Tue Jul 10 21:20:04 2018 -0700

    Fixed broken sphinx version check on MacOS
---
 configure.ac     | 57 +++++++++++++++++++++++++++++---------------------------
 doc/checkvers.sh | 40 ---------------------------------------
 2 files changed, 30 insertions(+), 67 deletions(-)

diff --git a/configure.ac b/configure.ac
index c08bba3..e85747e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -303,14 +303,26 @@ AC_ARG_ENABLE([docs],
   [AS_HELP_STRING([--enable-docs],[enable documentation building])],
   [
     enable_doc_build=yes
+    AM_PATH_PYTHON([2.4], [
+      dnl action-if-found
+      TS_MAN1_MANPAGES=`cd $srcdir/doc && $PYTHON manpages.py --section=1 | $AWK
'{print "$(BUILDDIR)/man/" $0 }' | tr '\n' ' '`
+      TS_MAN3_MANPAGES=`cd $srcdir/doc && $PYTHON manpages.py --section=3 | $AWK
'{print "$(BUILDDIR)/man/" $0 }' | tr '\n' ' '`
+      TS_MAN5_MANPAGES=`cd $srcdir/doc && $PYTHON manpages.py --section=5 | $AWK
'{print "$(BUILDDIR)/man/" $0 }' | tr '\n' ' '`
+      TS_MAN8_MANPAGES=`cd $srcdir/doc && $PYTHON manpages.py --section=8 | $AWK
'{print "$(BUILDDIR)/man/" $0 }' | tr '\n' ' '`
+    ], [
+      dnl action-if-not-found
+      :
+    ])
+
     AS_IF([test -z "$JAVA"],
       [
         enable_doc_build=no
         AC_ERROR([Doc building disabled, java required but not found])
       ])
     AC_ARG_VAR(SPHINXBUILD, [the sphinx-build documentation generator])
+    AC_ARG_VAR(SPHINXOPTS, [additional sphinx-build options])
     AC_PATH_PROG([SPHINXBUILD], [sphinx-build], [])
-    AS_IF(["$srcdir/doc/checkvers.sh" "$SPHINXBUILD" "$srcdir/doc/checkvers.py"],
+    AS_IF(["$PYTHON" "$srcdir/doc/checkvers.py" --check-version],
       [
         sphinx_version_check=yes
       ],[
@@ -318,11 +330,28 @@ AC_ARG_ENABLE([docs],
         enable_doc_build=no
         AC_ERROR([Doc building disabled, check sphinx installation])
       ])
+
+
+    AC_SUBST(TS_MAN1_MANPAGES)
+    AC_SUBST(TS_MAN3_MANPAGES)
+    AC_SUBST(TS_MAN5_MANPAGES)
+    AC_SUBST(TS_MAN8_MANPAGES)
+
+    AC_MSG_CHECKING([whether to build man pages])
+    AS_IF([test "x$sphinx_version_check" = "xyes" -a "x$SPHINXBUILD" != "xfalse"], [
+      build_manpages=true
+      AC_MSG_RESULT([yes])
+    ], [
+      build_manpages=false
+      AC_MSG_RESULT([no])
+    ])
+
   ],
   [enable_doc_build=no]
 )
 AC_MSG_RESULT([$enable_doc_build])
 AM_CONDITIONAL([BUILD_DOCS], [test "xyes" = "x$enable_doc_build"])
+AM_CONDITIONAL([BUILD_MANPAGES], [test "xtrue" = "x$build_manpages"])
 
 #
 # Remote Coverity Prevent commit
@@ -708,39 +737,13 @@ AC_CHECK_PROG(ASCPP, cpp, cpp)
 AC_CHECK_TOOL(AR, ar, ar)
 AC_ISC_POSIX
 
-AM_PATH_PYTHON([2.4], [
-  dnl action-if-found
-  TS_MAN1_MANPAGES=`cd $srcdir/doc && $PYTHON manpages.py --section=1 | $AWK '{print
"$(BUILDDIR)/man/" $0 }' | tr '\n' ' '`
-  TS_MAN3_MANPAGES=`cd $srcdir/doc && $PYTHON manpages.py --section=3 | $AWK '{print
"$(BUILDDIR)/man/" $0 }' | tr '\n' ' '`
-  TS_MAN5_MANPAGES=`cd $srcdir/doc && $PYTHON manpages.py --section=5 | $AWK '{print
"$(BUILDDIR)/man/" $0 }' | tr '\n' ' '`
-  TS_MAN8_MANPAGES=`cd $srcdir/doc && $PYTHON manpages.py --section=8 | $AWK '{print
"$(BUILDDIR)/man/" $0 }' | tr '\n' ' '`
-], [
-  dnl action-if-not-found
-  :
-])
-
 AC_ARG_VAR(RPATH, [path to be added to rpath])
-AC_ARG_VAR(SPHINXOPTS, [additional sphinx-build options])
 
 AC_ARG_VAR([CLANG_TIDY], [clang-tidy command])
 
 # Default CLANG_TIDY to "clang-tidy", or "false" if it is not present.
 AC_PATH_PROG([CLANG_TIDY], [clang-tidy],[false])
 
-AC_SUBST(TS_MAN1_MANPAGES)
-AC_SUBST(TS_MAN3_MANPAGES)
-AC_SUBST(TS_MAN5_MANPAGES)
-AC_SUBST(TS_MAN8_MANPAGES)
-
-AC_MSG_CHECKING([whether to build man pages])
-AS_IF([test "x$sphinx_version_check" = "xyes" -a "x$SPHINXBUILD" != "xfalse"], [
-  AM_CONDITIONAL([BUILD_MANPAGES], [true])
-  AC_MSG_RESULT([yes])
-], [
-  AM_CONDITIONAL([BUILD_MANPAGES], [false])
-  AC_MSG_RESULT([no])
-])
-
 # Do bison check by hand because we must do a version check.
 # Use YACC because it makes autotools shut up.
 BISON_MAJOR=2
diff --git a/doc/checkvers.sh b/doc/checkvers.sh
deleted file mode 100755
index 2e95771..0000000
--- a/doc/checkvers.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-if [[ ! -r "$1" ]]
-then
-    echo "Expecting sphinx-build executable at '$1' but could not read it" >&2
-    exit 1
-fi
-
-# We must grab the interpreter directive from the sphinx-build script to discover which python
installation should be used to check
-# the version.
-sphinx_build_PYTHON="$(head -n 1 "$1" | sed 's;^#! *;;')"
-
-if [[ ! -x "$sphinx_build_PYTHON" ]]
-then
-    echo "sphinx-build found at '$1' needs missing '$sphinx_build_PYTHON'" >&2
-    return 1
-fi
-
-if [[ ! -r "$2" ]]
-then
-    echo "Expecting sphinx version check script at '$1' but could not read it" >&2
-    exit 1
-fi
-
-"$sphinx_build_PYTHON" "$2" --check-version


Mime
View raw message