#!/bin/csh -f
foreach i (`cat $1`)
echo doing $i
co -q -l $i
if ($status == 0) then
   perl /mit/jtkohl/lib/perl/cpr.perl $i >$i.new
   if ($status == 0) then
      mv $i.new $i
      if ($status == 0) then
         ci -q -u -m"Update copyright notice" $i 
	 if ($status != 0) then
	       echo "checkin for $i failed"
	       echo $i " (ci)" >>/usr/tmp/FAILED
	 endif
      else
      	echo "move for $i failed"
	echo $i " (mv)" >>/usr/tmp/FAILED
      endif	
   else
   	echo "perl for $i failed"
	echo $i " (perl)" >>/usr/tmp/FAILED
   endif
else
	echo "checkout for $i failed"
	echo $i " (co)" >>/usr/tmp/FAILED
endif
end
