Source

vaultfs-main / update_externals.sh

Full commit
#!/bin/sh
get_or_update() {
    vcs=$2;name=$1;repo=$3;
    echo -n syncing $name \ 
    if [ ! -d "src/$name" ]
    then
        echo -n checkout\ 
        case $vcs in
            hg) hg clone -q $repo src/$name;;
            bzr) bzr checkout -q $repo src/$name;;
			svn) svn checkout -q $repo src/$name;
        esac
    else
        echo -n update\ 
        cd src/$name >/dev/null
        case $vcs in
            hg) hg pull -uq;;
            bzt) bzr update -q;;
			svn) svn update -q;;
        esac
        cd ../.. >/dev/null
    fi

    ln -sf src/$name/$name $name #XXX: asume normal forms
    cd src/$name >/dev/null
    echo -n build\ 
    python setup.py build_ext -i >/dev/null
    echo done
    cd ../.. >/dev/null
}

if [ ! `which bzr` ]
then
    print "Error: You must install bzr to update Kiwi."
    exit
fi

if [ ! `which hg` ]
then 
    print "Error: You must install Mercurial to update anyvnc and rope."
    exit
fi

if [ ! `which svn` ]
then 
    print "Error: You must install Subversion to update externals"
    exit
fi

FROM_WD=`pwd`
cd $(dirname $(dirname $PWD/$0))
mkdir -p externals/src >/dev/null
cd externals >/dev/null

#get_or_update rope hg http://www.bitbucket.org/agr/rope/
#get_or_update anyvc hg http://bitbucket.org/RonnyPfannschmidt/anyvc/
#get_or_update kiwi bzr lp:kiwi
#get_or_update pygtkhelpers hg http://bitbucket.org/aafshar/pygtkhelpers-main/

#get_or_update django svn http://code.djangoproject.com/svn/django/branches/releases/1.1.X/
#get_or_update piston hg http://bitbucket.org/jespern/django-piston/
get_or_update mptt svn http://django-mptt.googlecode.com/svn/trunk/


cd $FROM_WD