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

Re: [PATCH] Require Python 2.0 or later in autogen.sh and configure

From: Daniel Rall <dlr_at_finemaltcoding.com>
Date: 2005-08-23 22:08:31 CEST

On Mon, 22 Aug 2005, David James wrote:
...
> This patch updates autogen.sh and configure to look for Python in the
> following locations (in order) for Python 2.0 or better: $PYTHON2,
> $PYTHON, python, python2

This change looks good, +1.

...
> Index: build/find_python.sh
> ===================================================================
> --- build/find_python.sh (revision 0)
> +++ build/find_python.sh (revision 0)
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +
> +# Required version of Python
> +# Python 2.0 = 0x2000000
> +# Python 2.2 = 0x2020000
> +VERSION=${1:-0x2000000}
> +
> +for x in "$PYTHON2" "$PYTHON" python python2; do
> + DETECT_PYTHON2="import sys;sys.exit((sys.hexversion < $VERSION) and 1 or 0)"
> + if "$x" -c "$DETECT_PYTHON2" >/dev/null 2>/dev/null; then
> + echo $x
> + exit 0
> + fi
> +done
> +exit 1

How about $interpreter or $py_interp or something instead of $x?

...
> --- autogen.sh (revision 15884)
> +++ autogen.sh (working copy)
> @@ -65,33 +65,33 @@
> #
> # 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. Note
> -# that running gen-make.py requires Python 1.X or newer.
> +# that running gen-make.py requires Python 2.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"
> +PYTHON=`./build/find_python.sh`

You could put double quotes around the backticks if you want to support
spaces in that path for poor Bourne shell interpreters.

> +if test -z "$PYTHON"; then
> + echo "Python check failed, make sure python 2.x is installed and on the PATH"
> exit 1
> fi

This is a fatal error for autogen.sh. If $PYTHON or $PYTHON2 are also picked
up, how about mentioning them as well?

> if test -n "$SKIP_DEPS"; then
> echo "Creating build-outputs.mk (no dependencies)..."
> - python ./gen-make.py -s build.conf || gen_failed=1
> + "$PYTHON" ./gen-make.py -s build.conf || gen_failed=1
...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 23 22:11:30 2005

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.