File indexing completed on 2024-12-15 05:11:26

0001 #!/bin/sh
0002 #Alexander Neundorf <neundorf@kde.org>
0003 #copyright 2002, GPL
0004 
0005 #call this script to add all files in and below the current dir to SVN
0006 #it adds *.c, *.h, *.C, *.cpp, *.cc automatically
0007 #*~, *.o, *.so, *.lo, *.la, .libs/, .deps/, .#* are ignored
0008 #it asks for the remaining files
0009 
0010 
0011 #ignore dirs "CVS", ".deps", ".libs" ".svn"
0012 #ignore files *.o, *.so, *.lo, *.la, *~, .#*
0013 FOUND=`find |grep -v "^\.$"| grep -v CVS| grep -v "\.[ls]\?o$"|grep -v "~$"|grep -v "\.libs/"|grep -v "\.deps/" |grep -v "\.svn/" |grep -v "\.depend/"| grep -v "/\.#" |grep -v "\.la$"`
0014 #echo $FOUND
0015 
0016 ask_for_adding() {
0017 echo
0018 read "answer?Add file $file to SVN ? (y/n) " rest
0019 #if [ "$answer" != "y" ]; then echo $file; fi
0020 if [ "$answer" = "y" ]; then svn add $file; fi
0021 }
0022 
0023 
0024 for file in $FOUND
0025 do
0026 #matches all *.h, *.c, *.cpp, *.C, *.cpp, *.cc (and some others too)
0027    echo $file | grep "\.[cCh][cp]\?p\?$" && svn add $file
0028    echo $file | grep -v "\.[cCh][cp]\?p\?$" && ask_for_adding
0029 done
0030