builder_custom_init.sh 622 Bytes
Newer Older
1 2
#!/bin/echo Usage: . $0

3 4
# default to highest version we can find if no value in $1 and $2
if [ ! -z "$1" ]
5
then
6 7
    PREF_VER=$1.$2
else
8
    PREF_VER=2.7
9
fi
10

11
for PY_VER in ${PREF_VER} 2.7 2.6 2.5 2.4 2.3 2.2
12 13 14 15 16 17 18 19 20
do
    # used in pick python to use in Builder driver makefile
    export PYTHON=$( which python${PY_VER} )
    if [ -e "${PYTHON}" ]
    then
        break
    fi
done
unset PREF_VER
21

22 23 24
if [ -e "${PYTHON}" ]
then
    # prove the python version selected is as expected
25
    ${PYTHON} -c "import sys;print( 'Info: Python Version %r' % sys.version )"
26
else
27
    echo "Error: Cannot find python${PREF_VER} on the PATH"
28
fi