3 # Update the current version date in all files in the tree containing
4 # it. Consider all single-component-version release branches except
5 # those matching the regular expression in $IGNORE_BRANCHES, and also
6 # consider those branches listed in the space separated list in
9 GITROOT
=${GITROOT:-"/git/gcc.git"}
10 IGNORE_BRANCHES
='releases/gcc-(.*\..*|5|6|7)'
16 /bin
/rm -rf "$BASEDIR"
20 GIT
=${GIT:-/usr/local/bin/git}
22 # Compute the branches which we should update.
23 BRANCHES
=`(cd $GITROOT \
24 && ${GIT} for-each-ref --format='%(refname)' \
25 'refs/heads/releases/gcc-*') \
26 | sed -e 's/refs\/heads\///' \
27 | egrep -v $IGNORE_BRANCHES`
28 # Always update the mainline.
29 BRANCHES
="${ADD_BRANCHES} ${BRANCHES}"
31 # This is put into the datestamp files.
32 CURR_DATE
=`/bin/date +"%Y%m%d"`
34 datestamp_FILES
="gcc/DATESTAMP"
37 # Assume all will go well.
40 for BRANCH
in $BRANCHES; do
41 echo "Working on \"$BRANCH\"."
42 # Check out the files on the branch.
43 if [ -d "$SUBDIR" ]; then
46 ${GIT} checkout
-q "$BRANCH"
48 ${GIT} clone
-q -b "$BRANCH" "$GITROOT" "$SUBDIR"
51 # There are no files to commit yet.
55 for file in $datestamp_FILES; do
56 if test -f $file; then
57 echo "${CURR_DATE}" > $file.new
59 if /usr
/bin
/cmp -s $file $file.new
; then
63 COMMIT_FILES
="$COMMIT_FILES $file"
68 if test -n "$COMMIT_FILES"; then
69 for i
in $COMMIT_FILES; do
70 echo "Attempting to commit $i"
71 if ${GIT} commit
-m "Daily bump." $i; then
72 if ! ${GIT} push origin
"$BRANCH"; then
73 # If we could not push the files, indicate failure.
77 # If we could not commit the files, indicate failure.