diff --git a/admin-tools/setup-master.sh b/admin-tools/setup-master.sh index 83434522..377a0a76 100755 --- a/admin-tools/setup-master.sh +++ b/admin-tools/setup-master.sh @@ -1,6 +1,15 @@ #!/bin/bash PYTHON_VERSION=3.7.12 +function checkout_version { + local repo=$1 + version=${2:-master} + echo Checking out $version on $repo ... + (cd ../$repo && git checkout $version && pyenv local $PYTHON_VERSION) && \ + git pull + return $? +} + # FIXME put some of the below in a common routine function finish { cd $owd @@ -16,8 +25,7 @@ fi mydir=$(dirname $bs) fulldir=$(readlink -f $mydir) cd $fulldir/.. -(cd ../python-spark && git checkout master && pyenv local $PYTHON_VERSION) && git pull && \ - (cd ../python-xdis && git checkout master && pyenv local $PYTHON_VERSION) && git pull && \ - git checkout master && pyenv local $PYTHON_VERSION && git pull +(cd $fulldir/.. && checkout_version python-spark && checkout_version python-xdis && + checkout_version python-uncompyle6) cd $owd rm -v */.python-version >/dev/null 2>&1 || true diff --git a/admin-tools/setup-python-2.4.sh b/admin-tools/setup-python-2.4.sh index 3ed58d7e..8d42f1b6 100755 --- a/admin-tools/setup-python-2.4.sh +++ b/admin-tools/setup-python-2.4.sh @@ -1,6 +1,15 @@ #!/bin/bash PYTHON_VERSION=2.4.6 +function checkout_version { + local repo=$1 + version=${2:-python-2.4} + echo Checking out $version.4 on $repo ... + (cd ../$repo && git checkout $version && pyenv local $PYTHON_VERSION) && \ + git pull + return $? +} + owd=$(pwd) bs=${BASH_SOURCE[0]} if [[ $0 == $bs ]] ; then @@ -9,10 +18,7 @@ if [[ $0 == $bs ]] ; then fi mydir=$(dirname $bs) fulldir=$(readlink -f $mydir) -cd $fulldir/.. -(cd ../python-spark && git checkout python-2.4 && pyenv local $PYTHON_VERSION) && git pull && \ - (cd ../python-xdis && . ./admin-tools/setup-python-2.4.sh) && \ - git checkout python-2.4 && pyenv local $PYTHON_VERSION && git pull +(cd $fulldir/.. && checkout_version python-spark && checkout_version python-xdis python-2.4-to-2.7 && + checkout_version python-uncompyle6) cd $owd rm -v */.python-version || true -pyenv local $PYTHON_VERSION diff --git a/admin-tools/setup-python-3.3.sh b/admin-tools/setup-python-3.3.sh index 5af28261..4e244df3 100755 --- a/admin-tools/setup-python-3.3.sh +++ b/admin-tools/setup-python-3.3.sh @@ -2,13 +2,33 @@ PYTHON_VERSION=3.3.7 pyenv local $PYTHON_VERSION +# FIXME put some of the below in a common routine +function checkout_version { + local repo=$1 + version=${2:-python-3.3-to-3.5} + echo Checking out $version on $repo ... + (cd ../$repo && git checkout $version && pyenv local $PYTHON_VERSION) && \ + git pull + return $? +} + +function finish { + cd $owd +} + +export PATH=$HOME/.pyenv/bin/pyenv:$PATH owd=$(pwd) bs=${BASH_SOURCE[0]} +if [[ $0 == $bs ]] ; then + echo "This script should be *sourced* rather than run directly through bash" + exit 1 +fi mydir=$(dirname $bs) fulldir=$(readlink -f $mydir) cd $fulldir/.. -(cd ../python-xdis && ./admin-tools/setup-python-3.3.sh) +(cd $fulldir/.. && checkout_version python-spark master && checkout_version python-xdis && + checkout_version python-uncompyle6) cd $owd rm -v */.python-version || true