summaryrefslogtreecommitdiff
path: root/clone
blob: 0dd18b07d67f95034cf00067c9cd30b0a7b80bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh

# clone: checkout 

repo_name="$1"

default_branch="trunk"

set -e

# FIXME: don't assume script is run from the directory of asterisk-tools
# (clones to a sibling directory)
cd `dirname $0`

# FIXME: don't assume this directory is called asterisk-tools
mydirname='asterisk-tools'

case "$repo_name" in
dahdi-linux ) repo=dahdi/linux;;
dahdi-tools ) repo=dahdi/tools;;
asterisk ) repo="$1";;
libpri ) repo="$1"; default_branch="1.4";;
asterisk-gui ) repo="$1"; default_branch="2.0";;
esac

ignore_file="${repo_name}_gitignore"
if [ ! -r AUTHORS ]; then
	./get_authors >AUTHORS
fi
url="http://svn.asterisk.org/svn/$repo"

target_dir="../$repo_name"

echo "Cloning repository into $target_dir. This may take a while."
ignore_revs_param=''
if [ "$repo_name" = 'asterisk' ]; then
	ignore_revs_param='-r1-47393,47395:HEAD'
fi
git svn clone -s $ignore_revs_param -A AUTHORS "$url" "$target_dir"

cd "$target_dir"

../$mydirname/update_branches
../$mydirname/update_tags
../$mydirname/setup "$repo_name"
git branch --set-upstream "$default_branch"