[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: make check produces error

From: Greg Stein <gstein_at_lyra.org>
Date: 2001-12-13 23:15:56 CET

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
Received on Sat Oct 21 14:36:53 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.