# HG changeset patch # User Jeff Hammel # Date 1372440741 25200 # Node ID 915f88af9624695c24e65cea6515dc7e30823804 # Parent 93c8f28d485deed4854abcc978ea3f9b84cf12b4 transition diff -r 93c8f28d485d -r 915f88af9624 python/venvit.py --- a/python/venvit.py Fri Jun 28 10:26:54 2013 -0700 +++ b/python/venvit.py Fri Jun 28 10:32:21 2013 -0700 @@ -18,3 +18,42 @@ will be executed after installation (or a venvit.txt which would just be output to console, maybe falling back to the README """ + +import sys + +# class for VCS +# TODO: hg, git, ... + +# usage + +args = sys.argv[1:] +if len(args) != 1: + print "Usage: %prog " + + +# 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 diff -r 93c8f28d485d -r 915f88af9624 python/venvit2.py --- a/python/venvit2.py Fri Jun 28 10:26:54 2013 -0700 +++ b/python/venvit2.py Fri Jun 28 10:32:21 2013 -0700 @@ -1,9 +1,3 @@ -#!/usr/bin/python - -""" -make a virtualenv for the product -""" - import sys # class for VCS