comparison bin/venvit.sh @ 52:ac08d765aa32

allow cloning from hg instead of just svn
author Jeff Hammel <k0scist@gmail.com>
date Sun, 28 Mar 2010 16:38:51 -0400
parents f3ab51c79813
children 6463a7e37c45
comparison
equal deleted inserted replaced
51:1aacc851332b 52:ac08d765aa32
1 #!/bin/bash 1 #!/bin/bash
2 # make a virtualenv for the product
2 3
4 # usage
3 if (( $# != 1 )) 5 if (( $# != 1 ))
4 then 6 then
5 echo "Usage: $0 <svn-location>" 7 echo "Usage: $0 <svn-or-hg-location>"
6 exit 0 8 exit 0
7 fi 9 fi
8 10
11 # determine name of the package
9 NAME=$1 12 NAME=$1
10
11 for i in /trunk /branches /tag 13 for i in /trunk /branches /tag
12 do 14 do
13 NAME=${NAME%%$i*} 15 NAME=${NAME%%$i*}
14 done 16 done
15 NAME=${NAME##*/} 17 NAME=${NAME##*/}
16 18
17 #echo $NAME 19 if svn info $1 2> /dev/null
20 then
21 CHECKOUT="svn co"
22 else
23 CHECKOUT="hg clone"
24 fi
18 25
26 # create a virtualenv and install the software
19 VIRTUAL_ENV_LOCATION="${HOME}/virtualenv/virtualenv.py" 27 VIRTUAL_ENV_LOCATION="${HOME}/virtualenv/virtualenv.py"
20
21 python ${VIRTUAL_ENV_LOCATION} ${NAME} 28 python ${VIRTUAL_ENV_LOCATION} ${NAME}
22 cd ${NAME} 29 cd ${NAME}
23 source bin/activate 30 source bin/activate
24 mkdir src/ 31 mkdir src/
25 cd src/ 32 cd src/
26 svn co $1 ${NAME} 33 $CHECKOUT $1 ${NAME}
27 cd ${NAME} 34 cd ${NAME}
28 python setup.py develop 35 python setup.py develop