3 # Update the current version date in all files in the tree containing
4 # it. Consider all release branches except those matching the regular
5 # expression in $IGNORE_BRANCHES, and also consider those branches listed
8 SVNROOT=${SVNROOT:-"file:///svn/gcc"}
9 IGNORE_BRANCHES='gcc-(2_95|3_0|3_1|3_2|3_3|3_4)-branch'
10 ADD_BRANCHES='HEAD autovect-branch'
19 SVN=${SVN:-/usr/bin/svn}
21 # Compute the branches which we should update.
22 BRANCHES=`$SVN ls $SVNROOT/branches \
24 | egrep 'gcc-[0-9]+_[0-9]+-branch$' \
25 | egrep -v $IGNORE_BRANCHES`
26 # Always update the mainline.
27 BRANCHES="${BRANCHES} ${ADD_BRANCHES}"
29 # ARGS is passed to 'cvs co'
30 CURR_DATE=`/bin/date +"%Y%m%d"`
32 # version is contained within a char*
33 textstring_FILES="gcc/version.c"
35 # version is contained within a #define
36 cppdefine_FILES="libstdc++-v3/include/bits/c++config"
38 # version is all there is
39 datestamp_FILES="gcc/DATESTAMP"
41 FILES="$textstring_FILES $cppdefine_FILES $datestamp_FILES"
42 DIRS="$textstring_DIRS $cppdefine_DIRS $datestamp_DIRS"
44 # Assume all will go well.
46 for BRANCH in $BRANCHES; do
47 echo "Working on \"$BRANCH\"."
48 # Check out the files on the branch. HEAD is a special case; if
49 # you check out files with -r HEAD, CVS will not let you check
51 if test "$BRANCH" = HEAD; then
53 ${SVN} -q co -N ${SVNROOT}/trunk/`dirname $i` `basename $i`
57 ${SVN} -q co -N ${SVNROOT}/branches/${BRANCH}/`dirname $i` `basename $i`
61 # There are no files to commit yet.
64 for file in $textstring_FILES; do
65 dirname=`basename $file`
68 if test -f $file; then
69 /bin/sed <$file >$file.new -e \
70 "s/\(.*\"[^ ]*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
72 if /usr/bin/cmp -s $file $file.new; then
76 COMMIT_FILES="$COMMIT_FILES $file"
81 for file in $cppdefine_FILES; do
82 dirname=`basename $file`
85 if test -f $file; then
86 /bin/sed <$file >$file.new -e \
87 "s/\(#.*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
89 if /usr/bin/cmp -s $file $file.new; then
93 COMMIT_FILES="$COMMIT_FILES $file"
98 for file in $datestamp_FILES; do
99 dirname=`basename $file`
100 file=`basename $file`
101 file="$dirname/$file"
102 if test -f $file; then
103 echo ${CURR_DATE} > $file.new
105 if /usr/bin/cmp -s $file $file.new; then
108 mv -f $file.new $file
109 COMMIT_FILES="$COMMIT_FILES $file"
114 if test -n "$COMMIT_FILES"; then
115 for i in $COMMIT_FILES; do
116 echo "Attempting to commit $i"
117 if ! ${SVN} commit -m "Daily bump." $i; then
118 # If we could not commit the files, indicate failure.
126 rm -rf /tmp/$$/`basename $i`