blob: e5a58266327344e8a3c6f275e4af954bc18f0dde [file] [log] [blame]
Vikram S. Adve5e1a0d92002-09-15 16:45:10 +00001#!/bin/csh -f
Vikram S. Adve355df3f2002-02-11 20:59:26 +00002#
3# This script updates the entire tree, saves the output in cvs.out,
4# and then separately prints out the files that had merge conflicts,
5# those that were merged successfully, and those that are new.
6# Note that this script uses "cvs update -P -d".
7#
8# USAGE:
9# cvsupdate ## normal run
10# cvsupdate -n ## run grep commands on output of the last run of cvs
11# cvsupdate -h ## usage information
12#
13
14set pstatus = 0
15onintr cleanup
16alias usage 'echo "USAGE: $0:t [-h][-n]"; set pstatus = 1; goto cleanup'
17
18set doit = 1
Vikram S. Adve38bb2ff82002-10-31 15:32:24 +000019set printnew = 0
Vikram S. Adve355df3f2002-02-11 20:59:26 +000020unset options_done
21while ( !( $?options_done ) && ($#argv > 0))
22 switch ($argv[1])
23 case -h :
24 usage
25 case -n :
26 set doit = 0; shift argv; breaksw
Vikram S. Adve38bb2ff82002-10-31 15:32:24 +000027 case -new :
28 set printnew = 1; shift argv; breaksw
Vikram S. Adve355df3f2002-02-11 20:59:26 +000029 default :
30 set options_done; breaksw
31 endsw
32end
33
34if ($doit == 1) then
Misha Brukman3578d7e2003-05-25 16:38:24 +000035 /bin/mv -f cvs.out cvs.out.bak >&/dev/null
Vikram S. Adve355df3f2002-02-11 20:59:26 +000036 cvs update -P -d >& cvs.out
Vikram S. Adve38bb2ff82002-10-31 15:32:24 +000037## if ($status != 0) then
38## echo "ERROR: CVS update failed: "
39## cat cvs.out
40## exit 1
Vikram S. Adve5e1a0d92002-09-15 16:45:10 +000041 endif
Vikram S. Adve355df3f2002-02-11 20:59:26 +000042else
Vikram S. Adve38bb2ff82002-10-31 15:32:24 +000043 echo ""; echo "NOT UPDATING FILES. RESULTS FROM LAST RUN:"; echo ""
Vikram S. Adve355df3f2002-02-11 20:59:26 +000044endif
45
Chris Lattner868cb7d2002-04-29 19:11:01 +000046echo ""; echo " FILES UPDATED:"
Vikram S. Adveab9ef2a2004-10-30 23:11:26 +000047grep '^[UP] ' cvs.out
Chris Lattner868cb7d2002-04-29 19:11:01 +000048
49echo ""; echo " UPDATE CONFLICTS OCCURRED FOR THE FOLLOWING FILES:"
Vikram S. Adveab9ef2a2004-10-30 23:11:26 +000050grep '^C ' cvs.out
Vikram S. Adve355df3f2002-02-11 20:59:26 +000051
Vikram S. Adve65dea6e2004-10-29 17:43:19 +000052echo ""; echo " NEW FILES THAT NEED TO BE COMMITTED:"
Vikram S. Adveab9ef2a2004-10-30 23:11:26 +000053grep '^[AR] ' cvs.out
Vikram S. Adve65dea6e2004-10-29 17:43:19 +000054
Vikram S. Adveab9ef2a2004-10-30 23:11:26 +000055echo ""; echo " FILES REMOVED FROM YOUR DIRECTORY:"
Chris Lattnerfecaf562002-09-16 18:09:42 +000056grep 'no longer in the repository' cvs.out
57
Chris Lattner868cb7d2002-04-29 19:11:01 +000058echo ""; echo " FILES SUCCESSFULLY MERGED (or locally modified):"
Vikram S. Adveab9ef2a2004-10-30 23:11:26 +000059grep '^M ' cvs.out
Vikram S. Adve355df3f2002-02-11 20:59:26 +000060
61echo ""; echo " NEW FILES AND DIRECTORIES:"
Vikram S. Adve38bb2ff82002-10-31 15:32:24 +000062if ($printnew != 0) then
63 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'
64else
65 echo '(USE "cvsupdate -n -new" TO SEE NEW FILES AND DIRECTORIES.)'
66endif
Vikram S. Adve355df3f2002-02-11 20:59:26 +000067
68echo ""
69
70
71#=========================================================
72# CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED
73#=========================================================
74cleanup:
75 exit($pstatus)