3 CVSROOT
=${CVSROOT:-/cvs/gcc}
4 IGNORE_BRANCHES
='gcc-(2_95|3_0|3_1|3_2)-branch'
5 ADD_BRANCHES
='HEAD tree-ssa-20020619-branch'
14 CVS
=${CVS:-/usr/local/bin/cvs}
16 # Compute the branches which we should update.
18 BRANCHES
=`$CVS status -v gcc/ChangeLog \
20 | egrep 'gcc-[0-9]+_[0-9]+-branch$' \
21 | egrep -v $IGNORE_BRANCHES`
22 # Always update the mainline.
23 BRANCHES
="${BRANCHES} ${ADD_BRANCHES}"
25 # ARGS is passed to 'cvs co'
26 CURR_DATE
=`/bin/date +"%Y%m%d"`
28 # version is contained within a char*
29 textstring_FILES
="gcc/gcc/version.c"
31 # version is contained within a #define
32 cppdefine_FILES
="gcc/libstdc++-v3/include/bits/c++config"
34 # Assume all will go well.
37 for BRANCH
in $BRANCHES; do
38 echo "Working on \"$BRANCH\"."
39 # Check out the files on the branch. HEAD is a special case; if
40 # you check out files with -r HEAD, CVS will not let you check
42 if test "$BRANCH" = HEAD
; then
43 ${CVS} co
$textstring_FILES $cppdefine_FILES
45 ${CVS} co
-r $BRANCH $textstring_FILES $cppdefine_FILES
48 # There are no files to commit yet.
51 for file in $textstring_FILES; do
52 if test -f $file; then
53 /bin
/sed <$file >$file.new
-e \
54 "s/\(.*\"[^ ]*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
56 if /usr
/bin
/cmp -s $file $file.new
; then
60 COMMIT_FILES
="$COMMIT_FILES $file"
65 for file in $cppdefine_FILES; do
66 if test -f $file; then
67 /bin
/sed <$file >$file.new
-e \
68 "s/\(#.*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
70 if /usr
/bin
/cmp -s $file $file.new
; then
74 COMMIT_FILES
="$COMMIT_FILES $file"
79 if test -n "$COMMIT_FILES" \
80 && ! ${CVS} commit
-m "Daily bump." $COMMIT_FILES; then
81 # If we could not commit the files, indicate failure.