diff options
Diffstat (limited to 'clone')
-rwxr-xr-x | clone | 46 |
1 files changed, 46 insertions, 0 deletions
@@ -0,0 +1,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" |