3 # cvscheck - identify files added, changed, or removed
4 # in CVS working directory
6 # Contributed by Lowell Skoog <fluke!lowell@uunet.uu.net>
8 # This program should be run in a working directory that has been
9 # checked out using CVS. It identifies files that have been added,
10 # changed, or removed in the working directory, but not "cvs
11 # committed". It also determines whether the files have been "cvs
12 # added" or "cvs removed". For directories, it is only practical to
13 # determine whether they have been added.
18 # If we can't run CVS commands in this directory
19 cvs status .
> /dev
/null
2>&1
23 echo "$name: there is no version here; bailing out" 1>&2
27 # Identify files added to working directory
31 if [ $file = '.' -o $file = '..' ] ; then
36 if [ -f $file ] ; then
37 if cvs status
$file |
grep -s '^From:[ ]*New file' ; then
38 echo "file added: $file - not CVS committed"
39 changes
=`expr $changes + 1`
40 elif cvs status
$file |
grep -s '^From:[ ]*no entry for' ; then
41 echo "file added: $file - not CVS added, not CVS committed"
42 changes
=`expr $changes + 1`
46 elif [ -d $file -a $file != CVS.adm
] ; then
51 # If CVS commands don't work inside
52 cvs status .
> /dev
/null
2>&1
54 echo "directory added: $file - not CVS added"
55 changes
=`expr $changes + 1`
63 # Identify changed files
64 changedfiles
=`cvs diff | egrep '^diff' | awk '{print $3}'`
65 for file in $changedfiles ; do
66 echo "file changed: $file - not CVS committed"
67 changes
=`expr $changes + 1`
70 # Identify files removed from working directory
71 removedfiles
=`cvs status | egrep '^File:[ ]*no file' | awk '{print $4}'`
73 # Determine whether each file has been cvs removed
74 for file in $removedfiles ; do
75 if cvs status
$file |
grep -s '^From:[ ]*-' ; then
76 echo "file removed: $file - not CVS committed"
78 echo "file removed: $file - not CVS removed, not CVS committed"
80 changes
=`expr $changes + 1`