diff options
author | Jeffrey C. Ollie <jeff@ocjtech.us> | 2007-03-30 23:52:29 -0500 |
---|---|---|
committer | Jeffrey C. Ollie <jcollie@lt26923.campus.dmacc.edu> | 2009-09-01 08:43:14 -0500 |
commit | f0054fed7d8a82f297f65bbdc8237ec9537886d6 (patch) | |
tree | 9c2f884bd72524b437ba5b24861eff855b489cbc /bin/control_rancid.in | |
parent | cc23ff0d94f9fa2c01d9983656f7ee1d554da57f (diff) | |
download | rancid-f0054fed7d8a82f297f65bbdc8237ec9537886d6.tar.gz rancid-f0054fed7d8a82f297f65bbdc8237ec9537886d6.tar.xz rancid-f0054fed7d8a82f297f65bbdc8237ec9537886d6.zip |
Improved handling of ignore patterns.
Diffstat (limited to 'bin/control_rancid.in')
-rw-r--r-- | bin/control_rancid.in | 66 |
1 files changed, 46 insertions, 20 deletions
diff --git a/bin/control_rancid.in b/bin/control_rancid.in index e75c773..5acae2e 100644 --- a/bin/control_rancid.in +++ b/bin/control_rancid.in @@ -151,27 +151,53 @@ if [ ! -d $DIR ] ; 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 ) |