2002-09-15 16:45:10 +00:00
|
|
|
#!/bin/csh -f
|
2002-02-11 20:59:26 +00:00
|
|
|
#
|
|
|
|
# This script updates the entire tree, saves the output in cvs.out,
|
|
|
|
# and then separately prints out the files that had merge conflicts,
|
|
|
|
# those that were merged successfully, and those that are new.
|
|
|
|
# Note that this script uses "cvs update -P -d".
|
|
|
|
#
|
|
|
|
# USAGE:
|
|
|
|
# cvsupdate ## normal run
|
|
|
|
# cvsupdate -n ## run grep commands on output of the last run of cvs
|
|
|
|
# cvsupdate -h ## usage information
|
|
|
|
#
|
|
|
|
|
|
|
|
set pstatus = 0
|
|
|
|
onintr cleanup
|
|
|
|
alias usage 'echo "USAGE: $0:t [-h][-n]"; set pstatus = 1; goto cleanup'
|
|
|
|
|
|
|
|
set doit = 1
|
2002-10-31 15:32:24 +00:00
|
|
|
set printnew = 0
|
2002-02-11 20:59:26 +00:00
|
|
|
unset options_done
|
|
|
|
while ( !( $?options_done ) && ($#argv > 0))
|
|
|
|
switch ($argv[1])
|
|
|
|
case -h :
|
|
|
|
usage
|
|
|
|
case -n :
|
|
|
|
set doit = 0; shift argv; breaksw
|
2002-10-31 15:32:24 +00:00
|
|
|
case -new :
|
|
|
|
set printnew = 1; shift argv; breaksw
|
2002-02-11 20:59:26 +00:00
|
|
|
default :
|
|
|
|
set options_done; breaksw
|
|
|
|
endsw
|
|
|
|
end
|
|
|
|
|
|
|
|
if ($doit == 1) then
|
|
|
|
/bin/mv -f cvs.out cvs.out.bak
|
|
|
|
cvs update -P -d >& cvs.out
|
2002-10-31 15:32:24 +00:00
|
|
|
## if ($status != 0) then
|
|
|
|
## echo "ERROR: CVS update failed: "
|
|
|
|
## cat cvs.out
|
|
|
|
## exit 1
|
2002-09-15 16:45:10 +00:00
|
|
|
endif
|
2002-02-11 20:59:26 +00:00
|
|
|
else
|
2002-10-31 15:32:24 +00:00
|
|
|
echo ""; echo "NOT UPDATING FILES. RESULTS FROM LAST RUN:"; echo ""
|
2002-02-11 20:59:26 +00:00
|
|
|
endif
|
|
|
|
|
2002-04-29 19:11:01 +00:00
|
|
|
echo ""; echo " FILES UPDATED:"
|
|
|
|
grep '^U' cvs.out
|
|
|
|
|
|
|
|
echo ""; echo " UPDATE CONFLICTS OCCURRED FOR THE FOLLOWING FILES:"
|
2002-02-11 20:59:26 +00:00
|
|
|
grep '^C' cvs.out
|
|
|
|
|
2002-09-16 18:09:42 +00:00
|
|
|
echo ""; echo " FILES REMOVED FROM YOUR DIRECTORY:"
|
|
|
|
grep 'no longer in the repository' cvs.out
|
|
|
|
|
2002-04-29 19:11:01 +00:00
|
|
|
echo ""; echo " FILES SUCCESSFULLY MERGED (or locally modified):"
|
2002-02-11 20:59:26 +00:00
|
|
|
grep '^M' cvs.out | grep -v Merging
|
|
|
|
|
|
|
|
echo ""; echo " NEW FILES AND DIRECTORIES:"
|
2002-10-31 15:32:24 +00:00
|
|
|
if ($printnew != 0) then
|
|
|
|
grep '^\?' cvs.out | & grep -v '\.bc' | grep -v Updating | grep -v cvsup | grep -v 'cvs.out' | grep -v gnumake.out | grep -v '\.mc$' | grep -v '\.s$' | grep -v '\.native'
|
|
|
|
else
|
|
|
|
echo '(USE "cvsupdate -n -new" TO SEE NEW FILES AND DIRECTORIES.)'
|
|
|
|
endif
|
2002-02-11 20:59:26 +00:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
|
|
#=========================================================
|
|
|
|
# CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED
|
|
|
|
#=========================================================
|
|
|
|
cleanup:
|
|
|
|
exit($pstatus)
|