#! /bin/sh
name=cvscheck
changes=0
cvs status . > /dev/null 2>&1
if [ $? != 0 ] ; then
echo "$name: there is no version here; bailing out" 1>&2
exit 1
fi
for file in .* * ; do
if [ $file = '.' -o $file = '..' ] ; then
continue
fi
if [ -f $file ] ; then
if cvs status $file | grep -s '^From:[ ]*New file' ; then
echo "file added: $file - not CVS committed"
changes=`expr $changes + 1`
elif cvs status $file | grep -s '^From:[ ]*no entry for' ; then
echo "file added: $file - not CVS added, not CVS committed"
changes=`expr $changes + 1`
fi
elif [ -d $file -a $file != CVS.adm ] ; then
cd $file
cvs status . > /dev/null 2>&1
if [ $? != 0 ] ; then
echo "directory added: $file - not CVS added"
changes=`expr $changes + 1`
fi
cd ..
fi
done
changedfiles=`cvs diff | egrep '^diff' | awk '{print $3}'`
for file in $changedfiles ; do
echo "file changed: $file - not CVS committed"
changes=`expr $changes + 1`
done
removedfiles=`cvs status | egrep '^File:[ ]*no file' | awk '{print $4}'`
for file in $removedfiles ; do
if cvs status $file | grep -s '^From:[ ]*-' ; then
echo "file removed: $file - not CVS committed"
else
echo "file removed: $file - not CVS removed, not CVS committed"
fi
changes=`expr $changes + 1`
done
exit $changes