ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/yiiyama/Toolset/scripts/checkcvs
Revision: 1.2
Committed: Sat May 19 14:45:26 2012 UTC (12 years, 11 months ago) by yiiyama
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +18 -1 lines
Log Message:
mergeroot

File Contents

# Content
1 #!/bin/bash
2
3 checkcvs(){
4 local thisdir=$(cd $1; pwd)
5
6 if [ ! -d $thisdir/CVS ]; then
7 echo "cd $thisdir/..; cvs add $thisdir"
8 return
9 fi
10
11 list=`ls $thisdir`
12
13 for entry in $list; do
14 if [ $entry = "CVS" -o $entry = $(basename $0) -o $(expr "$entry" : '[^~]*[~]') -ne 0 ]; then
15 continue
16 fi
17
18 line=`grep \/$entry\/ $thisdir/CVS/Entries`
19
20 if [ -z "$line" ]; then
21 echo "cd $thisdir; cvs add $entry"
22 continue
23 fi
24
25 if [ -d $thisdir/$entry ]; then
26 checkcvs $thisdir/$entry
27 fi
28 done
29
30 return 0
31 }
32
33 exclude=
34 dir=
35 while [ $# -gt 0 ]; do
36 case $1 in
37 -x)
38 exclude=$2
39 shift
40 shift
41 ;;
42 *)
43 dir=$1
44 break
45 ;;
46 esac
47 done
48
49 checkcvs $dir "$exclude"
50 # exclusion not implemented yet