You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mo DeJong <su...@bayarea.net> on 2001/12/13 12:37:21 UTC

Re: make check produces error

On 13 Dec 2001 13:16:40 -0600
Ben Collins-Sussman <su...@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  <su...@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

Re: make check produces error

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Dec 13, 2001 at 03:34:17PM -0600, cmpilato@collab.net wrote:
>...
> Finally, do we want to repeat this test/warning at 'make check' time?

Yes.

> You know, somebody gets the source, ignores the warning at autogen.sh

"Most people" don't run autogen.sh. So they have nothing *besides*
Makefile.in to take care of them.

>...
> we could at 'make check' time just skip all the python tests if the
> right version of Python isn't detected:

I think we should add Mo's (to-be-revised) patch, and do the skipping as a
future enhancement. Mo's patch gives us a basis for doing this kind of
detection.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: make check produces error

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
I committed this in revision 938, and closed issue #592.  (In the
commit email, the log message doesn't say the issue number, but I've
already fixed that in the repository.)

Thanks, Mo!

-Karl

Mo DeJong <su...@bayarea.net> writes:
> 2001-12-20  Mo DeJong  <su...@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.py: New script that will check the
> 	installed version of python and print a warning
> 	unless python 2.X or newer is found.
> 
> Index: ./Makefile.in
> ===================================================================
> --- ./.svn/text-base/Makefile.in.svn-base	Wed Dec  5 06:57:05 2001
> +++ ./Makefile.in	Thu Dec 20 05:41:43 2001
> @@ -117,6 +117,7 @@
>  	@logfile=`pwd`/tests.log ; \
>  	echo > $$logfile ; \
>  	failed=no ; \
> +	$(PYTHON) $(top_srcdir)/pycheck.py ; \
>  	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 20 05:49:45 2001
> @@ -72,7 +72,15 @@
>  # Create the file detailing all of the build outputs for SVN.
>  #
>  # 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
> +#       and we can state that dev people need Python on their machine. Note
> +#       that running gen-make.py requires Python 1.X or newer.
> +
> +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 ;
> @@ -82,7 +90,7 @@
>  fi
>  
>  if test "$?" != "0"; then
> -  echo "gen-make.py failed, is python really installed?"
> +  echo "gen-make.py failed"
>    exit 1
>  fi
>  
> Index: ./configure.in
> ===================================================================
> --- ./.svn/text-base/configure.in.svn-base	Wed Dec  5 06:57:03 2001
> +++ ./configure.in	Thu Dec 20 05:41:43 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 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"
> +  ${PYTHON} ${abs_srcdir}/pycheck.py
>  fi
>  
>  AC_PATH_PROG(MAKEINFO, makeinfo, [echo cannot run makeinfo])
> Index: ./pycheck.py
> ===================================================================
> --- /dev/null	Tue May  5 13:32:27 1998
> +++ pycheck.py	Thu Dec 13 06:46:49 2001
> @@ -0,0 +1,5 @@
> +import sys
> +if sys.hexversion < 0x2000000:
> +  print "pycheck: WARNING, Python 2.X or newer is required to run tests."
> +  sys.exit(1)
> +sys.exit(0)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: make check produces error

Posted by Mo DeJong <su...@bayarea.net>.
On 20 Dec 2001 09:41:11 -0600
cmpilato@collab.net wrote:

> So, after applying this patch to my working copy, running
> autogen.sh/configure/make check, I have to ask the following question:
> 
>    Mo, did you even *try* your own patch before submitting it?

Sorry about that. I will be more careful with future patches.
Here is a revised (and tested) patch that will fix the problem.

2001-12-20  Mo DeJong  <su...@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.py: New script that will check the
	installed version of python and print a warning
	unless python 2.X or newer is found.

Index: ./Makefile.in
===================================================================
--- ./.svn/text-base/Makefile.in.svn-base	Wed Dec  5 06:57:05 2001
+++ ./Makefile.in	Thu Dec 20 05:41:43 2001
@@ -117,6 +117,7 @@
 	@logfile=`pwd`/tests.log ; \
 	echo > $$logfile ; \
 	failed=no ; \
+	$(PYTHON) $(top_srcdir)/pycheck.py ; \
 	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 20 05:49:45 2001
@@ -72,7 +72,15 @@
 # Create the file detailing all of the build outputs for SVN.
 #
 # 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
+#       and we can state that dev people need Python on their machine. Note
+#       that running gen-make.py requires Python 1.X or newer.
+
+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 ;
@@ -82,7 +90,7 @@
 fi
 
 if test "$?" != "0"; then
-  echo "gen-make.py failed, is python really installed?"
+  echo "gen-make.py failed"
   exit 1
 fi
 
Index: ./configure.in
===================================================================
--- ./.svn/text-base/configure.in.svn-base	Wed Dec  5 06:57:03 2001
+++ ./configure.in	Thu Dec 20 05:41:43 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 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"
+  ${PYTHON} ${abs_srcdir}/pycheck.py
 fi
 
 AC_PATH_PROG(MAKEINFO, makeinfo, [echo cannot run makeinfo])
Index: ./pycheck.py
===================================================================
--- /dev/null	Tue May  5 13:32:27 1998
+++ pycheck.py	Thu Dec 13 06:46:49 2001
@@ -0,0 +1,5 @@
+import sys
+if sys.hexversion < 0x2000000:
+  print "pycheck: WARNING, Python 2.X or newer is required to run tests."
+  sys.exit(1)
+sys.exit(0)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: make check produces error

Posted by cm...@collab.net.
> Greg Stein wrote:
> 
> > Instead of this, let's just write a Python script that checks its own
> > version and exits with 0 or 1. I think this should do the trick:
> 
> That is much better that what I had, adding it to revised patch.

So, after applying this patch to my working copy, running
autogen.sh/configure/make check, I have to ask the following question:

   Mo, did you even *try* your own patch before submitting it?

Read on.

> Index: Makefile.in
> ===================================================================
> --- .svn/text-base/Makefile.in.svn-base	Wed Dec  5 06:57:05 2001
> +++ Makefile.in	Thu Dec 13 06:49:40 2001
> @@ -117,6 +117,7 @@
>  	@logfile=`pwd`/tests.log ; \
>  	echo > $$logfile ; \
>  	failed=no ; \
> +	$(PYTHON) $(top_srcdir)/pycheck.sh ; \
>  	list='$(TEST_PROGRAMS) @FS_TEST_PROGRAMS@'; for prog in $$list; do \
>  	    chmod a+x $$prog ; \
>  	    progbase=`echo $$prog | sed 's?.*/??'` ; \

Here, you are going to run a script in the top-level Subversion
directory called "pycheck.sh".  That's great, except that there's
*not* a pycheck.sh.  Your patch creates pycheck.PY (emphasis added).

> Index: configure.in
> ===================================================================
> --- .svn/text-base/configure.in.svn-base	Wed Dec  5 06:57:03 2001
> +++ configure.in	Thu Dec 13 06:49:41 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 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

Here we are again, running the non-existent pycheck.sh.  This time, we
seem to be invoking a shell with this pycheck.sh and the path to
`python' as arguments.  Shouldn't this just be 

   $(PYTHON) $(top_srcdir)/pycheck.py ;

Please fix, test, and re-submit your patch so we can get this useful
functionality into the build system.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: make check produces error

Posted by Mo DeJong <su...@bayarea.net>.
On 13 Dec 2001 15:34:17 -0600
cmpilato@collab.net wrote:

...

> > +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
> > +
> 
> Right here, I think the error output should say that we require
> *Python 2 or greater* to be in the PATH.

My mistake. I should have added a comment there stating that only Python 1.X
is required to run gen-make.py (added to revised patch below).

> > -dnl Find a python binary, refer
> > +dnl Find a python 2.X binary, test cases will not run with in Python 1.X
> 
> That should be "...run within Python..." :-)

Doh!

> Finally, do we want to repeat this test/warning at 'make check' time?
> You know, somebody gets the source, ignores the warning at autogen.sh
> time because she doesn't plan to contribute.  Then ends up
> contributing later and freaks when she runs 'make check' -- in fact,
> we could at 'make check' time just skip all the python tests if the
> right version of Python isn't detected:

We already do that, and it does not help. The log currently reads:

START: basic_tests.py
<<< Please make sure you have Python 2 or better! >>>
...

Assuming that users will read things is a common error.
They need to be beaten over the head with this error message
since lots of folks will not have python 2 installed.

Greg Stein wrote:

> Instead of this, let's just write a Python script that checks its own
> version and exits with 0 or 1. I think this should do the trick:

That is much better that what I had, adding it to revised patch.

cheers
Mo


2001-12-13  Mo DeJong  <su...@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.py: New script that will check the
	installed version of python and print a warning
	unless python 2.X or newer is found.

Index: Makefile.in
===================================================================
--- .svn/text-base/Makefile.in.svn-base	Wed Dec  5 06:57:05 2001
+++ Makefile.in	Thu Dec 13 06:49:40 2001
@@ -117,6 +117,7 @@
 	@logfile=`pwd`/tests.log ; \
 	echo > $$logfile ; \
 	failed=no ; \
+	$(PYTHON) $(top_srcdir)/pycheck.sh ; \
 	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 06:47:16 2001
@@ -72,7 +72,15 @@
 # Create the file detailing all of the build outputs for SVN.
 #
 # 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
+#       and we can state that dev people need Python on their machine. Note
+#	that running gen-make.py requires Python 1.X or newer.
+
+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 ;
@@ -82,7 +90,7 @@
 fi
 
 if test "$?" != "0"; then
-  echo "gen-make.py failed, is python really installed?"
+  echo "gen-make.py failed"
   exit 1
 fi
 
Index: configure.in
===================================================================
--- .svn/text-base/configure.in.svn-base	Wed Dec  5 06:57:03 2001
+++ configure.in	Thu Dec 13 06:49:41 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 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.py
===================================================================
--- /dev/null   Tue May  5 13:32:27 1998
+++ pycheck.py  Thu Dec 13 06:46:49 2001
@@ -0,0 +1,5 @@
+import sys
+if sys.hexversion < 0x2000000:
+  print "pycheck: WARNING, Python 2.X or newer is required to run tests."
+  sys.exit(1)
+sys.exit(0)






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: make check produces error

Posted by cm...@collab.net.
Mo DeJong <su...@bayarea.net> writes:

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

Hey, Mo.  

<diversion>Hm...I just had a strange mental image of late 80s hip-hop
tunes with "Hey...Mo...Hey...Mo...!" cycling in the vocal
backdrop</diversion>

Just some quick notes:

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

Right here, I think the error output should say that we require
*Python 2 or greater* to be in the PATH.

> 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

That should be "...run within Python..." :-)

Finally, do we want to repeat this test/warning at 'make check' time?
You know, somebody gets the source, ignores the warning at autogen.sh
time because she doesn't plan to contribute.  Then ends up
contributing later and freaks when she runs 'make check' -- in fact,
we could at 'make check' time just skip all the python tests if the
right version of Python isn't detected:

    BEGIN commit_tests.py
    SKIPPED: Python 2.0 or greater not found.
    END commit_tests.py

or something.  Thoughts?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: make check produces error

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Dec 13, 2001 at 04:37:21AM -0800, Mo DeJong wrote:
>...
> 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.

Good idea.

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

Instead of this, let's just write a Python script that checks its own
version and exits with 0 or 1. I think this should do the trick:

import sys
if sys.hexversion < 0x2000000:
  sys.exit(1)
sys.exit(0)


The change in Makefile.in would be:

    $(PYTHON) $(top_srcdir)/ac-helpers/pycheck.py


That seems a bit clearer to me.

(of course, the other thing to do is apply the patch somebody submitted
 which removes 2'isms, but I'd prefer to just require v2)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org