# HG changeset patch # User Jeff Hammel # Date 1372440414 25200 # Node ID 93c8f28d485deed4854abcc978ea3f9b84cf12b4 # Parent 912aec4ab59b3faa424cfbe0b0c3aa43beff58c3 boo diff -r 912aec4ab59b -r 93c8f28d485d python/venvit2.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/venvit2.py Fri Jun 28 10:26:54 2013 -0700 @@ -0,0 +1,44 @@ +#!/usr/bin/python + +""" +make a virtualenv for the product +""" + +import sys + +# class for VCS +# TODO: hg, git, ... + +# usage + +args = sys.argv[1:] +if len(args) != 1: + print "Usage: %prog " +fi + +# determine name of the package +NAME= +for i in /trunk /branches /tag +do + NAME=${NAME%%$i*} +done +NAME=${NAME%%/} # remove trailing slash +NAME=${NAME##*/} + +if svn info $1 2> /dev/null +then + CHECKOUT="svn co" +else + CHECKOUT="hg clone" +fi + +# create a virtualenv and install the software +VIRTUAL_ENV_LOCATION="${HOME}/virtualenv/virtualenv.py" +python ${VIRTUAL_ENV_LOCATION} ${NAME} +cd ${NAME} +source bin/activate +mkdir src/ +cd src/ +$CHECKOUT $1 ${NAME} +cd ${NAME} +python setup.py develop