From 07b8c8946589819a4fafe23247303e9e243118c4 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 19 Aug 2012 18:17:08 +0300 Subject: clone: a script to automate git svn clone clone: A script to automate the cloning of Asterisk-related SVN repositories. --- clone | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 clone diff --git a/clone b/clone new file mode 100755 index 0000000..0dd18b0 --- /dev/null +++ b/clone @@ -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" -- cgit v1.2.3