Mercurial > hg > config
comparison python/venvit2.py @ 355:93c8f28d485d
boo
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Fri, 28 Jun 2013 10:26:54 -0700 |
| parents | |
| children | 915f88af9624 |
comparison
equal
deleted
inserted
replaced
| 354:912aec4ab59b | 355:93c8f28d485d |
|---|---|
| 1 #!/usr/bin/python | |
| 2 | |
| 3 """ | |
| 4 make a virtualenv for the product | |
| 5 """ | |
| 6 | |
| 7 import sys | |
| 8 | |
| 9 # class for VCS | |
| 10 # TODO: hg, git, ... | |
| 11 | |
| 12 # usage | |
| 13 | |
| 14 args = sys.argv[1:] | |
| 15 if len(args) != 1: | |
| 16 print "Usage: %prog <svn-or-hg-location>" | |
| 17 fi | |
| 18 | |
| 19 # determine name of the package | |
| 20 NAME= | |
| 21 for i in /trunk /branches /tag | |
| 22 do | |
| 23 NAME=${NAME%%$i*} | |
| 24 done | |
| 25 NAME=${NAME%%/} # remove trailing slash | |
| 26 NAME=${NAME##*/} | |
| 27 | |
| 28 if svn info $1 2> /dev/null | |
| 29 then | |
| 30 CHECKOUT="svn co" | |
| 31 else | |
| 32 CHECKOUT="hg clone" | |
| 33 fi | |
| 34 | |
| 35 # create a virtualenv and install the software | |
| 36 VIRTUAL_ENV_LOCATION="${HOME}/virtualenv/virtualenv.py" | |
| 37 python ${VIRTUAL_ENV_LOCATION} ${NAME} | |
| 38 cd ${NAME} | |
| 39 source bin/activate | |
| 40 mkdir src/ | |
| 41 cd src/ | |
| 42 $CHECKOUT $1 ${NAME} | |
| 43 cd ${NAME} | |
| 44 python setup.py develop |
