annotate bin/venvit.sh @ 87:c4126b9a185f

add the rebase extension to be enabled in hg
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 26 Aug 2010 15:57:24 -0700
parents ac08d765aa32
children 6463a7e37c45
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
1 #!/bin/bash
52
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
2 # make a virtualenv for the product
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
3
52
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
4 # usage
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
5 if (( $# != 1 ))
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
6 then
52
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
7 echo "Usage: $0 <svn-or-hg-location>"
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
8 exit 0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
9 fi
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
10
52
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
11 # determine name of the package
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
12 NAME=$1
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
13 for i in /trunk /branches /tag
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
14 do
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
15 NAME=${NAME%%$i*}
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
16 done
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
17 NAME=${NAME##*/}
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
18
52
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
19 if svn info $1 2> /dev/null
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
20 then
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
21 CHECKOUT="svn co"
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
22 else
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
23 CHECKOUT="hg clone"
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
24 fi
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
25
52
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
26 # create a virtualenv and install the software
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
27 VIRTUAL_ENV_LOCATION="${HOME}/virtualenv/virtualenv.py"
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
28 python ${VIRTUAL_ENV_LOCATION} ${NAME}
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
29 cd ${NAME}
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
30 source bin/activate
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
31 mkdir src/
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
32 cd src/
52
ac08d765aa32 allow cloning from hg instead of just svn
Jeff Hammel <k0scist@gmail.com>
parents: 0
diff changeset
33 $CHECKOUT $1 ${NAME}
0
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
34 cd ${NAME}
f3ab51c79813 adding configuration from https://svn.openplans.org/svn/config_jhammel/
k0s <k0scist@gmail.com>
parents:
diff changeset
35 python setup.py develop