mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-23 13:09:49 +00:00
9f9f6de983
Don't use finish in sourced admin programs
37 lines
853 B
Bash
37 lines
853 B
Bash
#!/bin/bash
|
|
# Check out python-3.0-to-3.2 and dependent development branches.
|
|
|
|
set -e
|
|
PYTHON_VERSION=3.0.1
|
|
|
|
bs=${BASH_SOURCE[0]}
|
|
if [[ $0 == $bs ]] ; then
|
|
echo "This script should be *sourced* rather than run directly through bash"
|
|
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)
|
|
fulldir=$(readlink -f $mydir)
|
|
cd $fulldir/..
|
|
(cd $fulldir/.. && checkout_version python-spark master && checkout_version python-xdis &&
|
|
checkout_version python-uncompyle6)
|
|
|
|
git pull
|
|
rm -v */.python-version || true
|
|
cd $owd
|