diff --git a/admin-tools/check-2.4-2.7-versions.sh b/admin-tools/check-2.4-2.7-versions.sh index 85374d297..2e3fe1bb4 100755 --- a/admin-tools/check-2.4-2.7-versions.sh +++ b/admin-tools/check-2.4-2.7-versions.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e function finish { cd $owd } @@ -25,3 +26,4 @@ for version in $PYVERSIONS; do fi echo === $version === done +finish diff --git a/admin-tools/setup-python-2.4.sh b/admin-tools/setup-python-2.4.sh index 8d42f1b67..2f56cba11 100755 --- a/admin-tools/setup-python-2.4.sh +++ b/admin-tools/setup-python-2.4.sh @@ -10,6 +10,10 @@ function checkout_version { return $? } +function finish { + cd $owd +} + owd=$(pwd) bs=${BASH_SOURCE[0]} if [[ $0 == $bs ]] ; then @@ -20,5 +24,5 @@ mydir=$(dirname $bs) fulldir=$(readlink -f $mydir) (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 +finish diff --git a/admin-tools/setup-python-3.0.sh b/admin-tools/setup-python-3.0.sh index 27282d53b..8a2cfaf56 100644 --- a/admin-tools/setup-python-3.0.sh +++ b/admin-tools/setup-python-3.0.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e PYTHON_VERSION=3.0.1 pyenv local $PYTHON_VERSION @@ -29,7 +30,7 @@ fulldir=$(readlink -f $mydir) cd $fulldir/.. (cd $fulldir/.. && checkout_version python-spark master && checkout_version python-xdis && checkout_version python-uncompyle6) -cd $owd -rm -v */.python-version || true git checkout python-3.0-to-3.2 && git pull && pyenv local $PYTHON_VERSION +rm -v */.python-version || true +finish diff --git a/admin-tools/setup-python-3.3.sh b/admin-tools/setup-python-3.3.sh index 4e244df34..5125c31b5 100755 --- a/admin-tools/setup-python-3.3.sh +++ b/admin-tools/setup-python-3.3.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e PYTHON_VERSION=3.3.7 pyenv local $PYTHON_VERSION @@ -28,8 +29,9 @@ mydir=$(dirname $bs) fulldir=$(readlink -f $mydir) cd $fulldir/.. (cd $fulldir/.. && checkout_version python-spark master && checkout_version python-xdis && - checkout_version python-uncompyle6) -cd $owd + checkout_version python-uncompyle6) rm -v */.python-version || true git checkout python-3.3-to-3.5 && git pull && pyenv local $PYTHON_VERSION +rm -v */.python-version || true +finish