diff --git a/admin-tools/checkout_common.sh b/admin-tools/checkout_common.sh new file mode 100644 index 000000000..c5ffd7f4e --- /dev/null +++ b/admin-tools/checkout_common.sh @@ -0,0 +1,21 @@ +# Common checkout routine +export PATH=$HOME/.pyenv/bin/pyenv:$PATH +bs=${BASH_SOURCE[0]} +mydir=$(dirname $bs) +fulldir=$(readlink -f $mydir) + +function setup_version { + local repo=$1 + version=$2 + echo Running setup $version on $repo ... + (cd ../$repo && . ./admin-tools/setup-${version}.sh) + return $? +} + +function checkout_finish { + branch=$1 + cd $uncompyle6_owd + git checkout $branch && pyenv local $PYTHON_VERSION && git pull + rc=$? + return $rc +} diff --git a/admin-tools/setup-master.sh b/admin-tools/setup-master.sh index 2683f71a2..7e1250588 100755 --- a/admin-tools/setup-master.sh +++ b/admin-tools/setup-master.sh @@ -1,6 +1,6 @@ #!/bin/bash # Check out master branch and dependent development master branches -PYTHON_VERSION=3.8.18 +PYTHON_VERSION=3.8 bs=${BASH_SOURCE[0]} if [[ $0 == $bs ]] ; then @@ -8,25 +8,13 @@ if [[ $0 == $bs ]] ; then exit 1 fi -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 $? -} - -owd=$(pwd) - -export PATH=$HOME/.pyenv/bin/pyenv:$PATH - mydir=$(dirname $bs) +uncompyle6_owd=$(pwd) +cd $mydir +. ./checkout_common.sh fulldir=$(readlink -f $mydir) cd $fulldir/.. -(cd $fulldir/.. && checkout_version python-spark && checkout_version python-xdis && - checkout_version python-uncompyle6) - -git pull -rm -v */.python-version || true -cd $owd +(cd $fulldir/.. && \ + setup_version python-spark master && \ + setup_version python-xdis python-3.6 ) +checkout_finish master diff --git a/admin-tools/setup-python-3.0.sh b/admin-tools/setup-python-3.0.sh index a4f941569..daefa6266 100644 --- a/admin-tools/setup-python-3.0.sh +++ b/admin-tools/setup-python-3.0.sh @@ -9,27 +9,13 @@ if [[ $0 == $bs ]] ; then exit 1 fi -# FIXME put some of the below in a common routine -function checkout_version { - local repo=$1 - version=${2:-python-3.0-to-3.2} - echo Checking out $version on $repo ... - (cd ../$repo && git checkout $version && pyenv local $PYTHON_VERSION) && \ - git pull - return $? -} - -owd=$(pwd) -trap finish EXIT - -export PATH=$HOME/.pyenv/bin/pyenv:$PATH - mydir=$(dirname $bs) +. ./checkout_common.sh fulldir=$(readlink -f $mydir) +cd $fulldir cd $fulldir/.. -(cd $fulldir/.. && checkout_version python-spark master && checkout_version python-xdis && - checkout_version python-uncompyle6) +(cd $fulldir/.. && \ + setup_version python-spark master && \ + checkout_version python-xdis python-3.0) -git pull -rm -v */.python-version || true -cd $owd +checkout_finish python-3.0-to-3.2 diff --git a/admin-tools/setup-python-3.3.sh b/admin-tools/setup-python-3.3.sh index 9603d06ef..d78694b9d 100755 --- a/admin-tools/setup-python-3.3.sh +++ b/admin-tools/setup-python-3.3.sh @@ -8,27 +8,12 @@ if [[ $0 == $bs ]] ; then exit 1 fi -# 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 $? -} - -owd=$(pwd) - -export PATH=$HOME/.pyenv/bin/pyenv:$PATH - mydir=$(dirname $bs) +. ./checkout_common.sh fulldir=$(readlink -f $mydir) cd $fulldir/.. -(cd $fulldir/.. && checkout_version python-spark master && checkout_version python-xdis && - checkout_version python-uncompyle6) -rm -v */.python-version || true +(cd $fulldir/.. && \ + setup_version python-spark master && \ + setup_version python-xdis python-3.3 ) -git pull -rm -v */.python-version || true -cd $owd +checkout_finish python-3.3-to-3.5