summaryrefslogtreecommitdiffstats
path: root/scripts/create_cvsignore
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /scripts/create_cvsignore
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'scripts/create_cvsignore')
-rwxr-xr-xscripts/create_cvsignore55
1 files changed, 55 insertions, 0 deletions
diff --git a/scripts/create_cvsignore b/scripts/create_cvsignore
new file mode 100755
index 00000000..2fb4c23e
--- /dev/null
+++ b/scripts/create_cvsignore
@@ -0,0 +1,55 @@
+#!/bin/sh
+# This script makes a preliminary .cvsignore in the current dir by
+# adding some standard stuff according to Makefile.am.
+# License: GPL
+
+addignore() {
+ test -f .cvsignore || \
+ ( touch .cvsignore && echo "created new .cvsignore" && cvs add .cvsignore )
+ grep -q "^$1\$" .cvsignore || \
+ ( echo "$1" >> .cvsignore && echo "added $1 to .cvsignore" )
+}
+
+recurse=0
+if test $# -eq 1; then
+ if test "$1" = "-r"; then
+ recurse=1
+ fi
+fi
+
+handledir() {
+ (
+ cd $1
+ if test -f Makefile.am; then
+ if test $recurse -eq 1; then
+ echo "Entering $1"
+ fi
+ addignore Makefile
+ addignore Makefile.in
+
+ bins=`perl -p -e 's/\\\s*\n/ /g' Makefile.am | grep _PROGRAMS | sed -e 's/.*=\s*//;s/#.*//;s/\$([^)]*)//'`
+ if test -n "$bins"; then
+ for prog in $bins; do
+ addignore "$prog"
+ done
+ fi
+ else
+ echo "Skipping $1"
+ fi
+ )
+}
+
+
+if test -f Makefile.am; then
+ if test $recurse -eq 1; then
+ find . -type d | grep -v CVS | sed -e 's,/$,,' | \
+ while read dir; do
+ handledir $dir
+ done
+ else
+ handledir .
+ fi
+else
+ echo "No Makefile.am found!"
+fi
+