gcc_release: Fix up thinko in the last commit, improve error message.

* gcc_release: Fix up thinko in the last commit, improve error
	message.  Commit all ChangeLog, DEV-PHASE and BASE-VER changes
	together, rather than doing dozens of separate commits.

From-SVN: r222042
This commit is contained in:
Jakub Jelinek 2015-04-13 10:44:56 +02:00 committed by Jakub Jelinek
parent 4fa6a2a079
commit 49bd12939f
2 changed files with 24 additions and 14 deletions

View File

@ -1,3 +1,9 @@
2015-04-13 Jakub Jelinek <jakub@redhat.com>
* gcc_release: Fix up thinko in the last commit, improve error
message. Commit all ChangeLog, DEV-PHASE and BASE-VER changes
together, rather than doing dozens of separate commits.
2015-04-12 Jakub Jelinek <jakub@redhat.com> 2015-04-12 Jakub Jelinek <jakub@redhat.com>
* gcc_release: For RELEASE_MAJOR 5+ only use the major * gcc_release: For RELEASE_MAJOR 5+ only use the major

View File

@ -109,45 +109,49 @@ build_sources() {
${SVN} -q co "${SVNROOT}/${SVNBRANCH}" "`basename ${SOURCE_DIRECTORY}`" ||\ ${SVN} -q co "${SVNROOT}/${SVNBRANCH}" "`basename ${SOURCE_DIRECTORY}`" ||\
error "Could not check out release sources" error "Could not check out release sources"
for x in `find ${SOURCE_DIRECTORY} -name ChangeLog`; do svnciargs=""
for x in `changedir ${SOURCE_DIRECTORY} && \
find . -name ChangeLog`; do
# Update this ChangeLog file only if it does not yet contain the # Update this ChangeLog file only if it does not yet contain the
# entry we are going to add. (This is a safety net for repeated # entry we are going to add. (This is a safety net for repeated
# runs of this script for the same release.) # runs of this script for the same release.)
if ! grep "GCC ${RELEASE} released." ${x} > /dev/null ; then if ! grep "GCC ${RELEASE} released." ${SOURCE_DIRECTORY}/${x} > /dev/null ; then
cat - ${x} > ${x}.new <<EOF cat - ${SOURCE_DIRECTORY}/${x} > ${SOURCE_DIRECTORY}/${x}.new <<EOF
${LONG_DATE} Release Manager ${LONG_DATE} Release Manager
* GCC ${RELEASE} released. * GCC ${RELEASE} released.
EOF EOF
mv ${x}.new ${x} || \ mv ${SOURCE_DIRECTORY}/${x}.new ${SOURCE_DIRECTORY}/${x} \
error "Could not update ${x}" || error "Could not update ${x}"
(changedir `dirname ${x}` && \ svnciargs="${svnciargs} ${x}"
${SVN} -q ci -m 'Mark ChangeLog' `basename ${x}`) || \
error "Could not commit ${x}"
fi fi
done done
# Update gcc/DEV-PHASE. # Update gcc/DEV-PHASE.
if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` = ${RELEASE} ]; then if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` != ${RELEASE} ]; then
[ ${RELEASE_MAJOR} -lt 5 ] && \ [ ${RELEASE_MAJOR} -lt 5 ] && \
error "Release number ${RELEASE} does not match BASE-VER" error "Release number ${RELEASE} does not match BASE-VER"
if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` \ if [ `cat ${SOURCE_DIRECTORY}/gcc/BASE-VER` \
= ${RELEASE_MAJOR}.`expr ${RELEASE_MINOR} - 1`.1 \ = ${RELEASE_MAJOR}.`expr ${RELEASE_MINOR} - 1`.1 \
-a x${RELEASE_REVISION} = x0 ]; then -a x${RELEASE_REVISION} = x0 ]; then
(changedir ${SOURCE_DIRECTORY}/gcc && \ (changedir ${SOURCE_DIRECTORY}/gcc && \
echo ${RELEASE} > BASE-VER && \ echo ${RELEASE} > BASE-VER) || \
${SVN} -q ci -m 'Bump release' BASE-VER) || \
error "Could not update BASE-VER" error "Could not update BASE-VER"
svnciargs="${svnciargs} gcc/BASE-VER"
else else
error "Release number ${RELEASE} does not match BASE-VER" error "Release number ${RELEASE} does not immediately follow BASE-VER"
fi fi
fi fi
(changedir ${SOURCE_DIRECTORY}/gcc && \ (changedir ${SOURCE_DIRECTORY}/gcc && \
: > DEV-PHASE && \ : > DEV-PHASE) || \
${SVN} -q ci -m 'Mark as release' DEV-PHASE) || \
error "Could not update DEV-PHASE" error "Could not update DEV-PHASE"
svnciargs="${svnciargs} gcc/DEV-PHASE"
(changedir ${SOURCE_DIRECTORY} && \
${SVN} -q ci -m 'Update ChangeLog and version files for release' ${svnciargs}) || \
error "Could not commit ChangeLog and version file updates"
# Make sure we tag the sources for a final release. # Make sure we tag the sources for a final release.
TAG="tags/gcc_`echo ${RELEASE} | tr . _`_release" TAG="tags/gcc_`echo ${RELEASE} | tr . _`_release"