From 1e2093ce37e6905b9a4f34c153949fe523866c07 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Thu, 29 Mar 2007 01:13:02 -0500 Subject: First attempt at adding git support. --- bin/rancid-cvs.in | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'bin/rancid-cvs.in') diff --git a/bin/rancid-cvs.in b/bin/rancid-cvs.in index 86ca065..3943348 100644 --- a/bin/rancid-cvs.in +++ b/bin/rancid-cvs.in @@ -87,7 +87,7 @@ cd $BASEDIR # RCS system RCSSYS=${RCSSYS:=cvs}; -if [ $RCSSYS != "cvs" -a $RCSSYS != "svn" ] ; then +if [ $RCSSYS != "cvs" -a $RCSSYS != "svn" -a $RCSSYS != "git" ] ; then echo "$RCSSYS is not a valid value for RCSSYS." exit 1 fi @@ -96,8 +96,12 @@ fi if [ ! -d $CVSROOT ]; then if [ $RCSSYS = cvs ]; then cvs -d $CVSROOT init - else + elif [ $RCSSYS = svn ]; then svnadmin create $CVSROOT @SVN_FSTYPE@ + else + # git does not use $CVSROOT, instead configs are stored in $BASEDIR + git init + echo "logs" >> .gitignore fi fi @@ -127,7 +131,7 @@ do cvs import -m "$GROUP" $GROUP new rancid cd $BASEDIR cvs checkout $GROUP - else + elif [ $RCSSYS = svn ]; then svn import -m "$GROUP" . file://$CVSROOT/$GROUP cd $BASEDIR svn checkout file://$CVSROOT/$GROUP $GROUP @@ -136,8 +140,10 @@ do cd $DIR if [ ! -d configs ]; then mkdir configs - $RCSSYS add configs - $RCSSYS commit -m 'new' configs + if [ $RCSSYS = cvs -o $RCSSYS = svn ]; then + $RCSSYS add configs + $RCSSYS commit -m 'new' configs + fi fi # main files @@ -152,7 +158,9 @@ do fi if [ ! -f router.db ]; then touch router.db - $RCSSYS add router.db + if [ $RCSSYS = cvs -o $RCSSYS = svn ]; then + $RCSSYS add router.db + fi $RCSSYS commit -m 'new' router.db fi done -- cgit