Remove old build rather than uploaded build.
[amitay/build-farm.git] / install_python.fns
1 # this script should be . included into the fns file
2 # of any system that needs an update to its python install
3
4 PATH=$HOME/python/bin:$PATH
5 export PATH
6
7 VERSION="Python-2.6.5"
8
9 do_install_python() {
10    ( 
11        mkdir -p python_install || exit 1
12        rsync -avz samba.org::ftp/tridge/python/$VERSION.tar python_install || exit 1
13        cd python_install || exit 1;
14        rm -rf $VERSION || exit 1
15        tar -xf $VERSION.tar || exit 1
16        cd $VERSION || exit 1
17        ./configure --prefix=$HOME/python --disable-ipv6 || exit 1
18        make || exit 1
19        make install || exit 1
20        cd ../.. || exit 1
21        rm -rf python_install || exit 1
22        rsync install_python.fns $HOME/python || exit 1
23    ) > install_python.$host.log 2>&1
24
25    rsync  -c -q --password-file=.password -z --timeout=200 install_python.$host.log $host@build.samba.org::build_farm_data/
26 }
27
28 if ! test -d $HOME/python || ! cmp install_python.fns $HOME/python/install_python.fns; then
29    # needs to be installed
30    do_install_python
31 fi