3 CVSROOT=${CVSROOT:-/cvs/gcc}
4 IGNORE_BRANCHES='gcc-(2_95|3_0|3_1|3_2)-branch'
13 CVS=${CVS:-/usr/local/bin/cvs}
15 # Compute the branches which we should update.
17 BRANCHES=`$CVS status -v gcc/ChangeLog \
19 | egrep 'gcc-[0-9]+_[0-9]+-branch$' \
20 | egrep -v $IGNORE_BRANCHES`
21 # Always update the mainline.
22 BRANCHES="${BRANCHES} HEAD"
24 # ARGS is passed to 'cvs co'
25 CURR_DATE=`/bin/date +"%Y%m%d"`
27 # version is contained within a char*
28 textstring_FILES="gcc/gcc/version.c"
30 # version is contained within a #define
31 cppdefine_FILES="gcc/libstdc++-v3/include/bits/c++config"
33 # Assume all will go well.
36 for BRANCH in $BRANCHES; do
37 echo "Working on \"$BRANCH\"."
38 # Check out the files on the branch. HEAD is a special case; if
39 # you check out files with -r HEAD, CVS will not let you check
41 if test "$BRANCH" = HEAD; then
42 ${CVS} co $textstring_FILES $cppdefine_FILES
44 ${CVS} co -r $BRANCH $textstring_FILES $cppdefine_FILES
47 # There are no files to commit yet.
50 for file in $textstring_FILES; do
51 if test -f $file; then
52 /bin/sed <$file >$file.new -e \
53 "s/\(.*\"[^ ]*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
55 if /usr/bin/cmp -s $file $file.new; then
59 COMMIT_FILES="$COMMIT_FILES $file"
64 for file in $cppdefine_FILES; do
65 if test -f $file; then
66 /bin/sed <$file >$file.new -e \
67 "s/\(#.*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
69 if /usr/bin/cmp -s $file $file.new; then
73 COMMIT_FILES="$COMMIT_FILES $file"
78 if test -n "$COMMIT_FILES" \
79 && ! ${CVS} commit -m "Daily bump." $COMMIT_FILES; then
80 # If we could not commit the files, indicate failure.