summaryrefslogtreecommitdiffstats
path: root/bin/rancid-cvs.in
diff options
context:
space:
mode:
authorJeffrey C. Ollie <jeff@ocjtech.us>2007-03-29 01:13:02 -0500
committerJeffrey C. Ollie <jeff@ocjtech.us>2008-02-13 14:47:59 -0600
commit1e2093ce37e6905b9a4f34c153949fe523866c07 (patch)
tree672448f52ada62fcbbe1d5020459890622abed74 /bin/rancid-cvs.in
parentb73f299e731fbddae095c0b5eff04717b6dce1af (diff)
downloadrancid-1e2093ce37e6905b9a4f34c153949fe523866c07.tar.gz
rancid-1e2093ce37e6905b9a4f34c153949fe523866c07.tar.xz
rancid-1e2093ce37e6905b9a4f34c153949fe523866c07.zip
First attempt at adding git support.
Diffstat (limited to 'bin/rancid-cvs.in')
-rw-r--r--bin/rancid-cvs.in20
1 files changed, 14 insertions, 6 deletions
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