diff options
author | Tzafrir Cohen <tzafrir@cohens.org.il> | 2012-08-19 18:17:08 +0300 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2012-08-19 18:17:08 +0300 |
commit | 07b8c8946589819a4fafe23247303e9e243118c4 (patch) | |
tree | 34dc73aa08c0595a6d95c432ac75c931be1b890c | |
parent | c02f36a7e470b09ef305510239c94f7eb82597b2 (diff) |
clone: a script to automate git svn clone
clone: A script to automate the cloning of Asterisk-related SVN
repositories.
-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" |