blob: 9ef6b8e7c38f9399befc55bfe83faabdc11fd43c [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
19unset options_done
20while ( !( $?options_done ) && ($#argv > 0))
21 switch ($argv[1])
22 case -h :
23 usage
24 case -n :
25 set doit = 0; shift argv; breaksw
26 default :
27 set options_done; breaksw
28 endsw
29end
30
31if ($doit == 1) then
32 /bin/mv -f cvs.out cvs.out.bak
33 cvs update -P -d >& cvs.out
Vikram S. Adve5e1a0d92002-09-15 16:45:10 +000034 if ($status != 0) then
35 echo "ERROR: CVS update failed: "
36 cat cvs.out
37 exit 1
38 endif
Vikram S. Adve355df3f2002-02-11 20:59:26 +000039else
40 echo ""; echo "Not updating files."; echo ""
41endif
42
Chris Lattner868cb7d2002-04-29 19:11:01 +000043echo ""; echo " FILES UPDATED:"
44grep '^U' cvs.out
45
46echo ""; echo " UPDATE CONFLICTS OCCURRED FOR THE FOLLOWING FILES:"
Vikram S. Adve355df3f2002-02-11 20:59:26 +000047grep '^C' cvs.out
48
Chris Lattnerfecaf562002-09-16 18:09:42 +000049echo ""; echo " FILES REMOVED FROM YOUR DIRECTORY:"
50grep 'no longer in the repository' cvs.out
51
Chris Lattner868cb7d2002-04-29 19:11:01 +000052echo ""; echo " FILES SUCCESSFULLY MERGED (or locally modified):"
Vikram S. Adve355df3f2002-02-11 20:59:26 +000053grep '^M' cvs.out | grep -v Merging
54
55echo ""; echo " NEW FILES AND DIRECTORIES:"
Chris Lattner868cb7d2002-04-29 19:11:01 +000056grep '^\?' 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'
Vikram S. Adve355df3f2002-02-11 20:59:26 +000057
58echo ""
59
60
61#=========================================================
62# CODE TO BE EXECUTED IF INTERRUPT IS RECEIVED
63#=========================================================
64cleanup:
65 exit($pstatus)