annotate python/venvit2.py @ 356:915f88af9624

transition
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 28 Jun 2013 10:32:21 -0700
parents 93c8f28d485d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
355
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 import sys
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 # class for VCS
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 # TODO: hg, git, ...
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 # usage
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 args = sys.argv[1:]
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 if len(args) != 1:
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 print "Usage: %prog <svn-or-hg-location>"
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 fi
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 # determine name of the package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 NAME=
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 for i in /trunk /branches /tag
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 do
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 NAME=${NAME%%$i*}
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 done
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 NAME=${NAME%%/} # remove trailing slash
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 NAME=${NAME##*/}
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 if svn info $1 2> /dev/null
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 then
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 CHECKOUT="svn co"
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 else
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 CHECKOUT="hg clone"
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 fi
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 # create a virtualenv and install the software
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30 VIRTUAL_ENV_LOCATION="${HOME}/virtualenv/virtualenv.py"
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 python ${VIRTUAL_ENV_LOCATION} ${NAME}
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 cd ${NAME}
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33 source bin/activate
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34 mkdir src/
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 cd src/
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36 $CHECKOUT $1 ${NAME}
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37 cd ${NAME}
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
38 python setup.py develop