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