summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey C. Ollie <jeff@ocjtech.us>2007-03-30 23:52:29 -0500
committerJeffrey C. Ollie <jeff@ocjtech.us>2008-02-13 14:50:29 -0600
commit5e3faeabb9a088ebca9681743f51d39d2c8d39a1 (patch)
treec06f810751a5ef0298778578677bea67957a5c0a
parent12a21a80727da447c47c8dd924038a2ef6f23178 (diff)
downloadrancid-5e3faeabb9a088ebca9681743f51d39d2c8d39a1.zip
rancid-5e3faeabb9a088ebca9681743f51d39d2c8d39a1.tar.gz
rancid-5e3faeabb9a088ebca9681743f51d39d2c8d39a1.tar.xz
Improved handling of ignore patterns.
-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 )