]> gcc.gnu.org Git - gcc.git/blob - maintainer-scripts/update_version
update_version: Add a trace of which branch we are currently working on.
[gcc.git] / maintainer-scripts / update_version
1 #!/bin/sh
2
3 # Run this from /tmp.
4 CVSROOT=${CVSROOT:-/cvs/gcc}
5 export CVSROOT
6 /bin/rm -rf /tmp/$$
7 /bin/mkdir /tmp/$$
8 cd /tmp/$$
9
10 # The path to cvs.
11 CVS=${CVS:-/usr/local/bin/cvs}
12
13 # Compute the branches which we should update.
14 $CVS co gcc/ChangeLog
15 BRANCHES=`$CVS status -v gcc/ChangeLog \
16 | awk '{print $1;}' \
17 | egrep 'gcc-[0-9]+_[0-9]+-branch$'`
18 # Always update the mainline.
19 BRANCHES="${BRANCHES} HEAD"
20
21 # ARGS is passed to 'cvs co'
22 CURR_DATE=`/bin/date +"%Y%m%d"`
23
24 # version is contained within a char*
25 textstring_FILES="gcc/gcc/version.c gcc/gcc/ada/gnatvsn.ads gcc/gcc/f/version.c gcc/libf2c/libF77/Version.c gcc/libf2c/libI77/Version.c gcc/libf2c/libU77/Version.c"
26
27 # version is contained within a #define
28 cppdefine_FILES="gcc/libstdc++-v3/include/bits/c++config"
29
30 # Assume all will go well.
31 RESULT=0
32
33 for BRANCH in $BRANCHES; do
34 echo "Working on \"$BRANCH\"."
35 # Check out the files on the branch. HEAD is a special case; if
36 # you check out files with -r HEAD, CVS will not let you check
37 # in changes.
38 if test "$BRANCH" = HEAD; then
39 ${CVS} co $textstring_FILES $cppdefine_FILES
40 else
41 ${CVS} co -r $BRANCH $textstring_FILES $cppdefine_FILES
42 fi
43
44 # There are no files to commit yet.
45 COMMIT_FILES=""
46
47 for file in $textstring_FILES; do
48 if test -f $file; then
49 /bin/sed <$file >$file.new -e \
50 "s/\(.*\"[^ ]*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
51
52 if /usr/bin/cmp -s $file $file.new; then
53 rm -f $file.new
54 else
55 mv -f $file.new $file
56 COMMIT_FILES="$COMMIT_FILES $file"
57 fi
58 fi
59 done
60
61 for file in $cppdefine_FILES; do
62 if test -f $file; then
63 /bin/sed <$file >$file.new -e \
64 "s/\(#.*\) [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/\1 ${CURR_DATE}/"
65
66 if /usr/bin/cmp -s $file $file.new; then
67 rm -f $file.new
68 else
69 mv -f $file.new $file
70 COMMIT_FILES="$COMMIT_FILES $file"
71 fi
72 fi
73 done
74
75 if test -n "$COMMIT_FILES" \
76 && ! ${CVS} commit -m "Daily bump." $COMMIT_FILES; then
77 # If we could not commit the files, indicate failure.
78 RESULT=1
79 fi
80
81 # Remove the files.
82 rm -rf gcc
83 done
84
85 /bin/rm -rf /tmp/$$
86 exit $RESULT
This page took 0.046639 seconds and 6 git commands to generate.