On 13 Dec 2001 13:16:40 -0600
Ben Collins-Sussman <sussman@collab.net> wrote:
> 
> The only errors you got were due to the fact that you don't have
> python 2.0 or greater installed.
...
This is going to keep coming up. We need to point out this very
common error in a clear way or we will continue to get this
"bug report" for years to come. This patch should fix the
problem once and for all.
cheers
Mo
2001-12-13  Mo DeJong  <supermo@bayarea.net>
        * Makefile.in: Check python version before running
        test cases.
        * autogen.sh: Check to see if python is installed
        before generating build files.
        * configure.in: Check installed python version.
        * pycheck.sh: New script that will check the
        installed version of python and print a warning
        if python 1.X is found.
Index: ./Makefile.in
===================================================================
--- ./.svn/text-base/Makefile.in.svn-base	Wed Dec  5 06:57:05 2001
+++ ./Makefile.in	Thu Dec 13 04:21:46 2001
@@ -117,6 +117,7 @@
         @logfile=`pwd`/tests.log ; \
         echo > $$logfile ; \
         failed=no ; \
+	$(SHELL) $(top_srcdir)/pycheck.sh $(PYTHON) ; \
         list='$(TEST_PROGRAMS) @FS_TEST_PROGRAMS@'; for prog in $$list; do \
             chmod a+x $$prog ; \
             progbase=`echo $$prog | sed 's?.*/??'` ; \
Index: ./autogen.sh
===================================================================
--- ./.svn/text-base/autogen.sh.svn-base	Wed Dec  5 06:57:05 2001
+++ ./autogen.sh	Thu Dec 13 03:58:17 2001
@@ -6,6 +6,7 @@
 for execfile in gen-make.py \
                 dist.sh \
                 buildcheck.sh \
+                pycheck.sh \
                 ac-helpers/get-neon-ver.sh \
                 ac-helpers/gnu-diff.sh \
                 ac-helpers/gnu-patch.sh \
@@ -73,6 +74,13 @@
 #
 # Note: this dependency on Python is fine: only SVN developers use autogen.sh
 #       and we can state that dev people need Python on their machine
+
+OK=`python -c 'print "OK"'`
+if test "${OK}" != "OK" ; then
+  echo "Python check failed, make sure python is installed and on the PATH"
+  exit 1
+fi
+
 if test "$1" = "-s"; then
   echo "Creating build-outputs.mk (no dependencies)..."
   ./gen-make.py -s build.conf ;
Index: ./configure.in
===================================================================
--- ./.svn/text-base/configure.in.svn-base	Wed Dec  5 06:57:03 2001
+++ ./configure.in	Thu Dec 13 04:00:11 2001
@@ -258,13 +258,17 @@
 AC_DEFINE_UNQUOTED(SVN_PATH_STRIP_TRAILING_SLASHDOT, 0,
         [Non-zero if the trailing /. in paths should be stripped])
 
-dnl Find a python binary, refer
+dnl Find a python 2.X binary, test cases will not run with in Python 1.X
 
 AC_PATH_PROG(PYTHON2, python2, none)
 if test "$PYTHON2" = "none"; then
-	AC_PATH_PROG(PYTHON, python, fail-without-python)
+	AC_PATH_PROG(PYTHON, python, none)
 else
         PYTHON=$PYTHON2
+fi
+if test "$PYTHON" != "none"; then
+  echo "checking for Python 2.0 or newer"
+  ${SHELL} ${abs_srcdir}/pycheck.sh ${PYTHON}
 fi
 
 AC_PATH_PROG(MAKEINFO, makeinfo, [echo cannot run makeinfo])
Index: ./pycheck.sh
===================================================================
--- /dev/null	Tue May  5 13:32:27 1998
+++ pycheck.sh	Thu Dec 13 04:17:27 2001
@@ -0,0 +1,22 @@
+#! /bin/sh
+
+# pycheck: Check that Python 2.0 or newer is available.
+# The test cases will not run in python 1.X.
+#
+# Usage : pycheck PYTHON_PATH
+
+python=$1
+py_version=`${python} -c "import sys; print sys.version" \
+    | head -1 | sed -e 's/ (.*//'`
+if test -z "$py_version"; then
+echo "pycheck: Python version string not found, is python installed?"
+exit 1
+fi
+IFS=.; set $py_version; IFS=' '
+if test "$1" = "1"; then
+  echo "pycheck: WARNING, You have Python $py_version but Python 2.0 or"
+  echo "newer is required. Python based test cases will not be run."
+  exit 1
+fi
+
+exit 0
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:53 2006