summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/control_rancid.in68
1 files changed, 46 insertions, 22 deletions
diff --git a/bin/control_rancid.in b/bin/control_rancid.in
index ffef024..d339d66 100644
--- a/bin/control_rancid.in
+++ b/bin/control_rancid.in
@@ -152,29 +152,53 @@ then
fi
cd $DIR
-# create a .cvsignore
-if [ ! -f .cvsignore ]
-then
- rm -f .cvsignore
- cat >.cvsignore <<EOF
-.cvsignore
-.gitignore
-routers.all
-routers.down
-routers.up
-EOF
- if [ $RCSSYS = svn ]
- then
- svn propset svn:ignore -F .cvsignore .
- fi
-fi
+create_ignore () {
+ echo "*~"
+ echo "routers.added"
+ echo "routers.all"
+ echo "routers.all.new"
+ echo "routers.db"
+ echo "routers.deleted"
+ echo "routers.down"
+ echo "routers.down.new"
+ echo "routers.failed"
+ echo "routers.mail"
+ echo "routers.single"
+ echo "routers.up"
+ echo "routers.up.new"
+ echo "routers.up.missed"
+}
-# create a .cvsignore
-if [ ! -f .cvsignore ]
-then
- rm -f .cvsignore
- cp .cvsignore .gitignore
-fi
+case $RCSSYS in
+ cvs )
+ if [ ! -f .cvsignore ]; then
+ rm -f .cvsignore
+ create_ignore > .cvsignore
+ cvs add .cvsignore
+ cvs commit -m "Adding .cvsignore"
+ fi
+ ;;
+ svn )
+ svn proplist . | grep -q 'svn:ignore'
+ if [ $? -ne 0 ]; then
+ create_ignore > .svnignore
+ svn propset svn:ignore -F .svnignore .
+ svn commit -m "Adding svn:ignore"
+ rm -f .svnignore
+ fi
+ ;;
+ git )
+ if [ ! -f .gitignore ]; then
+ rm -f .gitignore
+ create_ignore > .gitignore
+ (
+ flock -x 200
+ git add .gitignore
+ git commit -m "Adding .gitignore"
+ ) 200>$BASEDIR/.lockfile
+ fi
+ ;;
+esac
case $RCSSYS in
cvs | svn )